Skip to content

Commit

Permalink
fixed failed assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
bodintsov committed Jan 9, 2025
1 parent bdf304e commit 7bbb40e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/requests/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def has_permission(self, request, view):
raise exceptions.ValidationError({'institution': 'Institution is does not exist.'})

if not institution.institutional_request_access_enabled:
raise exceptions.PermissionDenied({'institution': 'Institutional request is not enabled.'})
raise exceptions.PermissionDenied({'institution': 'Institutional request access is not enabled.'})

if get_user_auth(request).user.is_institutional_admin(institution):
return True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def test_institutional_admin_unauth_institution(self, app, project, institution_

res = app.post_json_api(url, create_payload, auth=institutional_admin.auth, expect_errors=True)
assert res.status_code == 403
assert 'You do not have permission to perform this action for this institution.' in res.json['errors'][0]['detail']
assert 'Institutional request access is not enabled.' in res.json['errors'][0]['detail']

@mock.patch('api.requests.serializers.send_mail')
def test_email_not_sent_without_recipient(self, mock_mail, app, project, institutional_admin, url,
Expand Down

0 comments on commit 7bbb40e

Please sign in to comment.