[damned-lies] Made modal parameter to help view optional



commit deaba3a56dc27d8f8e5a049e87911cea75f05f04
Author: Claude Paroz <claude 2xlibre net>
Date:   Sat May 14 10:56:55 2016 +0200

    Made modal parameter to help view optional

 common/views.py    |    4 +++-
 damnedlies/urls.py |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/common/views.py b/common/views.py
index ca63f62..32e8e8b 100644
--- a/common/views.py
+++ b/common/views.py
@@ -135,4 +135,6 @@ def help(request, topic, modal):
         t = get_template(template)
     except TemplateDoesNotExist:
         raise Http404
-    return render(request, template, {'base': 'base_modal.html' if int(modal) else 'base.html'})
+    return render(request, template, {
+        'base': 'base_modal.html' if modal and int(modal) else 'base.html'
+    })
diff --git a/damnedlies/urls.py b/damnedlies/urls.py
index 935ab86..ba7ad51 100644
--- a/damnedlies/urls.py
+++ b/damnedlies/urls.py
@@ -23,7 +23,7 @@ urlpatterns = [
     url(r'^register/$',
         common_views.site_register,
         name='register'),
-    url(r'^help/(?P<topic>\w+)/(?P<modal>[0-1])/$',
+    url(r'^help/(?P<topic>\w+)/(?P<modal>[0-1])?/?$',
         common_views.help,
         name='help'),
     url(r'^register/success$',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]