From 51845808b741736ebe1c2c9493b93b03ec30b265 Mon Sep 17 00:00:00 2001 From: Tyler Adam Martinez Date: Fri, 23 Jan 2026 18:14:25 -0600 Subject: [PATCH 1/2] [views/surface_water] Update sidebar label --- admin/views/surface_water.py | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/admin/views/surface_water.py b/admin/views/surface_water.py index e20496c1..2560de24 100644 --- a/admin/views/surface_water.py +++ b/admin/views/surface_water.py @@ -1,18 +1,3 @@ -# =============================================================================== -# Copyright 2025 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# =============================================================================== """ SurfaceWaterDataAdmin view for NMSampleLocations. """ @@ -25,8 +10,8 @@ class SurfaceWaterDataAdmin(OcotilloModelView): Admin view for SurfaceWaterData legacy model. """ - name = "Surface Water" - label = "Surface Water" + name = "NMA Surface Water Data" + label = "NMA Surface Water Data" icon = "fa fa-water" enable_publish_actions = False @@ -77,6 +62,3 @@ class SurfaceWaterDataAdmin(OcotilloModelView): "source_notes", "data_source", ] - - -# ============= EOF ============================================= From 324b89f4b27a2765086a7bda98f45639d92b8ece Mon Sep 17 00:00:00 2001 From: Tyler Adam Martinez Date: Mon, 26 Jan 2026 15:46:08 -0600 Subject: [PATCH 2/2] [surface_water] Update admin panel to be read-only --- admin/views/surface_water.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/admin/views/surface_water.py b/admin/views/surface_water.py index 2560de24..ede5522c 100644 --- a/admin/views/surface_water.py +++ b/admin/views/surface_water.py @@ -1,3 +1,18 @@ +# =============================================================================== +# Copyright 2025 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# =============================================================================== """ SurfaceWaterDataAdmin view for NMSampleLocations. """ @@ -62,3 +77,20 @@ class SurfaceWaterDataAdmin(OcotilloModelView): "source_notes", "data_source", ] + + # ========== READ ONLY ========== + enable_publish_actions = ( + False # hides publish/unpublish actions inherited from base + ) + + def can_create(self, request) -> bool: + return False + + def can_edit(self, request) -> bool: + return False + + def can_delete(self, request) -> bool: + return False + + +# ============= EOF =============================================