From 1ef5e13f4828ea1107e9ce3e92cd562e63e85c4f Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sat, 19 May 2018 12:01:53 +0200 Subject: [PATCH] Remove duplicate short_url declarations --- umap/settings/base.py | 1 - umap/urls.py | 5 ++--- umap/views.py | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/umap/settings/base.py b/umap/settings/base.py index e6490bc5..62529b83 100644 --- a/umap/settings/base.py +++ b/umap/settings/base.py @@ -164,7 +164,6 @@ UMAP_DEMO_SITE = False UMAP_EXCLUDE_DEFAULT_MAPS = False UMAP_MAPS_PER_PAGE = 5 UMAP_MAPS_PER_PAGE_OWNER = 10 -MAP_SHORT_URL_NAME = "umap_short_url" UMAP_USE_UNACCENT = False UMAP_FEEDBACK_LINK = "https://wiki.openstreetmap.org/wiki/UMap#Feedback_and_help" # noqa USER_MAPS_URL = 'user_maps' diff --git a/umap/urls.py b/umap/urls.py index 5b735b87..03526259 100644 --- a/umap/urls.py +++ b/umap/urls.py @@ -21,7 +21,8 @@ admin.autodiscover() urlpatterns = [ url(r'^admin/', admin.site.urls), url('', include('social_django.urls', namespace='social')), - url(r'^m/(?P\d+)/$', views.MapShortUrl.as_view(), name='umap_short_url'), + url(r'^m/(?P\d+)/$', views.MapShortUrl.as_view(), + name='map_short_url'), url(r'^ajax-proxy/$', cache_page(180)(views.ajax_proxy), name='ajax-proxy'), url(r'^change-password/', auth_views.password_change, @@ -43,8 +44,6 @@ i18n_urls = [ views.MapOldUrl.as_view(), name='map_old_url'), url(r'^map/anonymous-edit/(?P.+)$', views.MapAnonymousEditUrl.as_view(), name='map_anonymous_edit_url'), - url(r'^m/(?P\d+)/$', views.MapShortUrl.as_view(), - name='map_short_url'), url(r'^pictogram/json/$', views.PictogramJSONList.as_view(), name='pictogram_list_json'), ] diff --git a/umap/views.py b/umap/views.py index bac84e58..e1d26a7f 100644 --- a/umap/views.py +++ b/umap/views.py @@ -439,9 +439,7 @@ class MapView(MapDetailMixin, DetailView): def get_short_url(self): shortUrl = None if hasattr(settings, 'SHORT_SITE_URL'): - short_url_name = getattr(settings, 'MAP_SHORT_URL_NAME', - 'map_short_url') - short_path = reverse_lazy(short_url_name, + short_path = reverse_lazy('map_short_url', kwargs={'pk': self.object.pk}) shortUrl = "%s%s" % (settings.SHORT_SITE_URL, short_path) return shortUrl