model_permissions.middleware

class model_permissions.middleware.RedirectMiddleware(get_response)[source]

Bases: object

Middleware to redirect PermissionDenied exceptions.

By default, users are redirected to the LOGIN_URL. To change this, set MODEL_PERMISSIONS_REDIRECT_URL in your settings.

process_exception(request, exception)[source]

Redirect a PermissionDenied exception.