{% blocktrans %}Insufficient permissions{% endblocktrans %}
+{% blocktrans %}You don't have enough permissions for this operation.{% endblocktrans %}
+diff --git a/mayan/apps/appearance/templates/403.html b/mayan/apps/appearance/templates/403.html new file mode 100644 index 0000000000..0199abb707 --- /dev/null +++ b/mayan/apps/appearance/templates/403.html @@ -0,0 +1,14 @@ +{% extends 'appearance/base.html' %} + +{% load i18n %} + +{% block title %} :: {% blocktrans %}Insufficient permissions{% endblocktrans %}{% endblock %} + +{% block content %} +
{% blocktrans %}You don't have enough permissions for this operation.{% endblocktrans %}
+{% blocktrans %}Sorry, but the requested page could not be found.{% endblocktrans %}
{% trans "There's been an error. It's been reported to the site administrators via e-mail and should be fixed shortly. Thanks for your patience." %}
+ + {% if request.sentry.id %} +{% trans 'If you need assistance, you may reference this error via the following identifier:' %}
+{{ request.sentry.id }}
+ {% endif %} +Sorry, but the requested page is unavailable due to a server problem.
- -Administrators have been notified, so check back later.
- {% if request.sentry.id %} -If you need assistance, you may reference this error as - {{ request.sentry.id }}.
- {% endif %} - - - diff --git a/mayan/apps/permissions/middleware/__init__.py b/mayan/apps/permissions/middleware/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/mayan/apps/permissions/middleware/permission_denied_middleware.py b/mayan/apps/permissions/middleware/permission_denied_middleware.py deleted file mode 100644 index 19a42bf7ed..0000000000 --- a/mayan/apps/permissions/middleware/permission_denied_middleware.py +++ /dev/null @@ -1,41 +0,0 @@ -from __future__ import unicode_literals - -from django.conf import settings -from django.core.exceptions import PermissionDenied -from django.http import HttpResponseForbidden -from django.template import RequestContext, Template, loader, TemplateDoesNotExist -from django.utils.importlib import import_module - - -# http://mitchfournier.com/2010/07/12/show-a-custom-403-forbidden-error-page-in-django/ -class PermissionDeniedMiddleware(object): - def process_exception(self, request, exception): - if isinstance(exception, PermissionDenied): - try: - # Handle import error but allow any type error from view - callback = getattr(import_module(settings.ROOT_URLCONF), 'handler403') - return callback(request, exception) - except (ImportError, AttributeError): - # Try to get a 403 template - try: - # First look for a user-defined template named "403.html" - t = loader.get_template('403.html') - except TemplateDoesNotExist: - # If a template doesn't exist in the projct, use the following hardcoded template - t = Template('''{% load i18n %} - - - -