Browse Source

Don't crash on crawler jam check.

Ralfp 12 years ago
parent
commit
b56a79aeb7
1 changed files with 5 additions and 2 deletions
  1. 5 2
      misago/bruteforce/decorators.py

+ 5 - 2
misago/bruteforce/decorators.py

@@ -4,7 +4,10 @@ from misago.views import error403
 def block_jammed(f):
     def decorator(*args, **kwargs):
         request = args[0]
-        if not request.firewall.admin and request.jam.is_jammed():
-            return error403(request, _("You have used up allowed attempts quota and we temporarily banned you from accessing this page."))
+        try:
+            if not request.firewall.admin and request.jam.is_jammed():
+                return error403(request, _("You have used up allowed attempts quota and we temporarily banned you from accessing this page."))
+        except AttributeError:
+            pass
         return f(*args, **kwargs)
     return decorator