diff options
author | Frederick Muriuki Muriithi | 2024-06-10 16:43:23 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-06-10 16:47:02 -0500 |
commit | 29e077e1f2f49e1cc3162731a9b5359fa21a6ba1 (patch) | |
tree | 86bdf6041021ae2bb608d949b9ac32c19c9ef451 /gn_auth/auth/authorisation/roles | |
parent | 43a9bcb8182c4f470ad6d5b613e93db3833e3022 (diff) | |
download | gn-auth-29e077e1f2f49e1cc3162731a9b5359fa21a6ba1.tar.gz |
Improve error messaging.
Diffstat (limited to 'gn_auth/auth/authorisation/roles')
-rw-r--r-- | gn_auth/auth/authorisation/roles/models.py | 4 |
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, ...]: |