Merge pull request #1346 from umap-project/short-url-none
Make sure SHORT_SITE_URL is defined to expose Map.short_url
This commit is contained in:
commit
cae52c905a
1 changed files with 4 additions and 4 deletions
|
@ -585,11 +585,11 @@ class MapView(MapDetailMixin, PermissionsMixin, DetailView):
|
||||||
return self.object.pk
|
return self.object.pk
|
||||||
|
|
||||||
def get_short_url(self):
|
def get_short_url(self):
|
||||||
shortUrl = None
|
short_url = None
|
||||||
if hasattr(settings, "SHORT_SITE_URL"):
|
if getattr(settings, "SHORT_SITE_URL", None):
|
||||||
short_path = reverse_lazy("map_short_url", kwargs={"pk": self.object.pk})
|
short_path = reverse_lazy("map_short_url", kwargs={"pk": self.object.pk})
|
||||||
shortUrl = "%s%s" % (settings.SHORT_SITE_URL, short_path)
|
short_url = "%s%s" % (settings.SHORT_SITE_URL, short_path)
|
||||||
return shortUrl
|
return short_url
|
||||||
|
|
||||||
def get_geojson(self):
|
def get_geojson(self):
|
||||||
map_settings = self.object.settings
|
map_settings = self.object.settings
|
||||||
|
|
Loading…
Reference in a new issue