Commit 6f11a3f2 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

astakos: Remove duplicate project query

Enrolling a user in a project now returns 409 if the project does
not exist, rather than 404.
parent 2cd62e78
......@@ -511,7 +511,6 @@ def enroll_member_by_email(project_id, email, request_user=None, reason=None):
def enroll_member(project_id, user, request_user=None, reason=None):
project = get_project_for_update(project_id)
project = get_project_for_update(project_id)
except ProjectNotFound as e:
......@@ -352,6 +352,10 @@ class ProjectAPITest(TestCase):
status, body = self.enroll(project_id, self.user1, h_owner)
self.assertEqual(status, 409)
# Enroll fails, project does not exist
status, body = self.enroll(-1, self.user1, h_owner)
self.assertEqual(status, 409)
# Get projects
## Simple user mode
r = client.get(reverse("api_projects"), **h_plain)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment