]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/views/decorators.py
Removes a few remaining usages of old django decorators and replace them by OSQA...
[osqa.git] / forum / views / decorators.py
index 758b6876294907998de3fec82cee22fabfef30b0..f72703b906cfb030da76559b2a9ce66ffd0910a1 100644 (file)
@@ -8,6 +8,12 @@ from django.utils.translation import ungettext, ugettext as _
 from forum.modules import ui, decorate\r
 import logging\r
 \r
+def login_required(func, request, *args, **kwargs):\r
+    if not request.user.is_authenticated():\r
+        return HttpResponseRedirect(reverse('auth_signin'))\r
+    else:\r
+        return func(request, *args, **kwargs)\r
+\r
 def render(template=None, tab=None, tab_title='', weight=500, tabbed=True):\r
     def decorator(func):        \r
         def decorated(context, request, *args, **kwargs):\r