aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-06-10 16:43:23 -0500
committerFrederick Muriuki Muriithi2024-06-10 16:47:02 -0500
commit29e077e1f2f49e1cc3162731a9b5359fa21a6ba1 (patch)
tree86bdf6041021ae2bb608d949b9ac32c19c9ef451
parent43a9bcb8182c4f470ad6d5b613e93db3833e3022 (diff)
downloadgn-auth-29e077e1f2f49e1cc3162731a9b5359fa21a6ba1.tar.gz
Improve error messaging.
-rw-r--r--gn_auth/auth/authorisation/roles/models.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gn_auth/auth/authorisation/roles/models.py b/gn_auth/auth/authorisation/roles/models.py
index 699e3b3..b559bff 100644
--- a/gn_auth/auth/authorisation/roles/models.py
+++ b/gn_auth/auth/authorisation/roles/models.py
@@ -27,8 +27,8 @@ class Role:
def check_user_editable(role: Role):
"""Raise an exception if `role` is not user editable."""
if not role.user_editable:
- raise AuthorisationError(
- f"The role `{role.role_name}` is not user editable.")
+ raise AuthorisationError(f"The role `{role.role_name}` is a default "
+ "role and thus cannot be edited/changed.")
def db_rows_to_roles(rows) -> tuple[Role, ...]: