From 0a4a3f8f6d086f8692d06da1cb8026526aaa46c3 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 23 Apr 2026 12:29:01 -0500 Subject: Improve error messages. --- gn_auth/auth/authorisation/resources/models.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'gn_auth/auth') diff --git a/gn_auth/auth/authorisation/resources/models.py b/gn_auth/auth/authorisation/resources/models.py index 9e30386..27ef183 100644 --- a/gn_auth/auth/authorisation/resources/models.py +++ b/gn_auth/auth/authorisation/resources/models.py @@ -333,8 +333,7 @@ def link_data_to_resource( """Link data to resource.""" if not can_edit(conn, user.user_id, resource_id): raise AuthorisationError( - "You are not authorised to link data to resource with id " - f"{resource_id}") + "You are not authorised to link/unlink data to this resource.") resource = with_db_connection(partial( resource_by_id, user=user, resource_id=resource_id)) @@ -349,8 +348,7 @@ def unlink_data_from_resource( """Unlink data from resource.""" if not can_edit(conn, user.user_id, resource_id): raise AuthorisationError( - "You are not authorised to link data to resource with id " - f"{resource_id}") + "You are not authorised to link/unlink data this resource.") resource = with_db_connection(partial( resource_by_id, user=user, resource_id=resource_id)) -- cgit 1.4.1