exceptions.py 601 B

12345678910111213141516171819202122232425
  1. from django.core.exceptions import PermissionDenied
  2. class AjaxError(Exception):
  3. """You've tried to do something over AJAX but misago blurped"""
  4. def __init__(self, message=None, code=406):
  5. self.message = message
  6. self.code = code
  7. class Banned(PermissionDenied):
  8. def __init__(self, ban=None):
  9. if ban:
  10. self.ban = ban
  11. class ExplicitFirstPage(Exception):
  12. """The url that was used to reach view contained explicit first page"""
  13. pass
  14. class OutdatedSlug(Exception):
  15. """The url that was used to reach view contained outdated slug"""
  16. pass