Skip to content

Commit

Permalink
Fix over-zealous validation
Browse files Browse the repository at this point in the history
  • Loading branch information
tudoramariei committed Nov 6, 2024
1 parent 821a85b commit fbf68c2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions backend/hub/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,18 +816,15 @@ def post(self, request, *args, **kwargs):

user = self.request.user
user_org: Organization = user.organization
candidate: Candidate = self.object
candidate: Candidate = self.get_object()

if not user_org:
raise PermissionDenied

if not user_org.is_complete_for_candidate:
raise PermissionDenied

if not candidate:
raise PermissionDenied

if not candidate.is_complete:
if not candidate == user_org.candidate:
raise PermissionDenied

return super().post(request, *args, **kwargs)
Expand Down

0 comments on commit fbf68c2

Please sign in to comment.