Do not try to access self.object in MapCreate
This commit is contained in:
parent
42eb0e6ded
commit
168cc01c2e
1 changed files with 2 additions and 2 deletions
|
@ -451,7 +451,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(),
|
||||
|
@ -462,7 +462,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
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue