From 4d14cf6589f840f737a5a0ae87a6b5d026711a37 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sun, 10 Sep 2023 09:34:13 +0200 Subject: [PATCH] Do not try to access self.object in MapCreate --- umap/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/umap/views.py b/umap/views.py index e74c0789..bf839daa 100644 --- a/umap/views.py +++ b/umap/views.py @@ -450,7 +450,7 @@ class MapDetailMixin: "tilelayers": TileLayer.get_list(), "allowEdit": self.is_edit_allowed(), # showEditMode "allowMapEdit": self.object.can_edit(self.request.user, self.request) - if self.object + if getattr(self, "object", None) else True, # FIXME naming "default_iconUrl": "%sumap/img/marker.png" % settings.STATIC_URL, # noqa "umap_id": self.get_umap_id(), @@ -461,7 +461,7 @@ class MapDetailMixin: ], "umap_version": VERSION, } - if self.object.owner: + if getattr(self, "object", None) and self.object.owner: properties["edit_statuses"] = [ (i, str(label)) for i, label in Map.EDIT_STATUS ]