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