We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c38f1a commit 35c7f0fCopy full SHA for 35c7f0f
1 file changed
ietf/utils/response.py
@@ -0,0 +1,10 @@
1
+# Copyright The IETF Trust 2020, All Rights Reserved
2
+# -*- coding: utf-8 -*-
3
+
4
+from django.core.exceptions import PermissionDenied
5
+from django.utils.safestring import mark_safe
6
7
+def permission_denied(request, msg):
8
+ "A wrapper around the PermissionDenied exception"
9
+ msg += " <br/>You can <a href='/accounts/login?next=%s'><u>Log in</u></a> if you have that role but aren't logged in." % request.path
10
+ raise PermissionDenied(mark_safe(msg))
0 commit comments