Fix the slightly incomplete logic for changing private story permissions

This commit fixes the validation to be less overzealous. Previously
it was impossible to remove the last team from a story in the same
PUT request as adding users when the permissions previously had no
users, and vice versa.

Change-Id: I16a7451e8c24da352357abb0590d0ace5b4e77f4
This commit is contained in:
Adam Coldrick 2016-12-07 20:46:33 +00:00
parent db050a3de6
commit 8a69377c46
1 changed files with 2 additions and 2 deletions

View File

@ -305,9 +305,9 @@ class StoriesController(rest.RestController):
valid = True
if users == [] and teams == []:
valid = False
elif users == [] and original_teams == []:
elif users == [] and (original_teams == [] and not teams):
valid = False
elif teams == [] and original_users == []:
elif teams == [] and (original_users == [] and not users):
valid = False
if not valid and original_story.private:
abort(400,