Commit 00bde819 authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

support legacy urls

close #249
parent 70b069ba
......@@ -55,7 +55,7 @@ urlpatterns = [
url(r'^apps/(?P<docker_name>[\w-]+)/$', views.JobCreate.as_view(), name='webapp_detail'),
url(r'^tags/$', views.TagList.as_view(), name='tag_list'),
url(r'^tags/(?P<slug>[\w-]+)/$', views.TagWebappList.as_view(), name='tag_webapp_list'),
url(r'^tags/(?P<slug>[\w-]+)$', views.TagWebappList.as_view(), name='tag_webapp_list'),
url(r'^jobs/$', views.JobList.as_view(), name='job_list'),
url(r'^jobs/(?P<pk>\d+)/$', views.JobDetail.as_view(), name='job_detail'),
......@@ -77,4 +77,8 @@ urlpatterns = [
url(r'^auth$', views.auth, name="auth"),
# important legacy URLs (from the rails implementation)
url(r'^webapps/(?P<pk>\d+)/?$', views.LegacyWebappDetail.as_view()),
url(r'^app/(?P<slug>[\w-]+)/?$', views.LegacyWebappDetail.as_view()),
]
......@@ -114,6 +114,15 @@ class IndexDetail(TemplateView):
return context
# Legacy views
class LegacyWebappDetail(SingleObjectMixin, RedirectView):
model = Webapp
permanent = True
slug_field = "docker_name"
def get_redirect_url(self, **kwargs):
return reverse("main:webapp_detail",
args=(self.get_object().docker_name,))
# WEBAPPS
# -----------------------------------------------------------------------------
class WebappList(ListView):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment