From 29e077e1f2f49e1cc3162731a9b5359fa21a6ba1 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 10 Jun 2024 16:43:23 -0500 Subject: Improve error messaging. --- gn_auth/auth/authorisation/roles/models.py | 4 ++-- 1 file 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, ...]: -- cgit v1.2.3