Skip to content

Commit 8cb9583

Browse files
[weather_data] Update admin panel to be read-only
1 parent 999b17c commit 8cb9583

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

admin/views/weather_data.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,17 @@ class WeatherDataAdmin(OcotilloModelView):
5050
"weather_id": "WeatherID",
5151
"object_id": "OBJECTID",
5252
}
53+
54+
# ========== READ ONLY ==========
55+
enable_publish_actions = (
56+
False # hides publish/unpublish actions inherited from base
57+
)
58+
59+
def can_create(self, request) -> bool:
60+
return False
61+
62+
def can_edit(self, request) -> bool:
63+
return False
64+
65+
def can_delete(self, request) -> bool:
66+
return False

0 commit comments

Comments
 (0)