From e319fa963ef57e1cb64556fa84ca0f0b92249916 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sat, 4 Aug 2018 15:26:12 +0200 Subject: [PATCH] Make sure map name is always read from backend fix #605 --- umap/models.py | 5 +++-- umap/views.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/umap/models.py b/umap/models.py index 6197ef38..7bdd3be5 100644 --- a/umap/models.py +++ b/umap/models.py @@ -189,7 +189,8 @@ class Map(NamedModel): elif request.user == self.owner: can = True else: - can = not (self.share_status == self.PRIVATE and request.user not in self.editors.all()) + can = not (self.share_status == self.PRIVATE + and request.user not in self.editors.all()) return can @property @@ -204,7 +205,7 @@ class Map(NamedModel): new.pk = None new.name = u"%s %s" % (_("Clone of"), self.name) if "owner" in kwargs: - # can be None in case of anonymous cloning + # can be None in case of anonymous cloning new.owner = kwargs["owner"] new.save() for editor in self.editors.all(): diff --git a/umap/views.py b/umap/views.py index 922ccb68..b920629f 100644 --- a/umap/views.py +++ b/umap/views.py @@ -350,7 +350,7 @@ class MapDetailMixin: model = Map def get_context_data(self, **kwargs): - context = super(MapDetailMixin, self).get_context_data(**kwargs) + context = super().get_context_data(**kwargs) properties = { 'urls': _urls_for_js(), 'tilelayers': TileLayer.get_list(), @@ -447,6 +447,7 @@ class MapView(MapDetailMixin, DetailView): map_settings = self.object.settings if "properties" not in map_settings: map_settings['properties'] = {} + map_settings['properties']['name'] = self.object.name permissions = {} permissions['edit_status'] = self.object.edit_status permissions['share_status'] = self.object.share_status