1. Daniel Greenfeld
  2. transifex

Commits

Dimitris Glezos  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.

  • Participants
  • Parent commits 3109094
  • Branches default

Comments (0)

Files changed (1)

File transifex/txcommon/templatetags/txcommontags.py

View file
 @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