Commits

Anonymous committed 388f72d

bugfix: Check if the request object is valid before using it.

In the 500 error page, the request object seems empty, so let's
check its GET attribute before actually using it.

Comments (0)

Files changed (1)

transifex/txcommon/templatetags/txcommontags.py

 @register.filter
 def get_next(request):
     """Return the next path from the request."""
-    next = request.GET.get('next')
-    if not next:
-        next = request.path
-    return next
+    if getattr(request, 'GET', None):
+        next = request.GET.get('next', '')
+        if not next:
+            next = request.path
+        return next