decorators.py 438 B

12345678910
  1. from django.utils.translation import ugettext as _
  2. from misago.views import error403
  3. def block_jammed(f):
  4. def decorator(*args, **kwargs):
  5. request = args[0]
  6. if not request.firewall.admin and request.jam.is_jammed():
  7. return error403(request, _("You have used up allowed attempts quota and we temporarily banned you from accessing this page."))
  8. return f(*args, **kwargs)
  9. return decorator