From 0cd387b9a9c27cc70e4e935edaeab8b472a6206c Mon Sep 17 00:00:00 2001 From: Daniel Ursache Dogariu Date: Fri, 22 Nov 2024 16:12:42 +0200 Subject: [PATCH] Add more error messages --- backend/hub/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/hub/views.py b/backend/hub/views.py index 5891beea..cd61f9a0 100644 --- a/backend/hub/views.py +++ b/backend/hub/views.py @@ -933,20 +933,20 @@ def get_success_url(self): def post(self, request, *args, **kwargs): if not FeatureFlag.flag_enabled(PHASE_CHOICES.enable_candidate_editing): - raise PermissionDenied + raise PermissionDenied(_("Candidate editing disabled")) user = self.request.user user_org: Organization = user.organization candidate: Candidate = self.get_object() if not user_org: - raise PermissionDenied + raise PermissionDenied(_("No user organization")) if not candidate: - raise PermissionDenied + raise PermissionDenied(_("No candidate")) if not candidate == user_org.candidate: - raise PermissionDenied + raise PermissionDenied(_("Candidate does not belong to user organization")) return super().post(request, *args, **kwargs)