Eliminate all of the exceptions when running the tests.

This commit is contained in:
jakedt 2014-03-18 15:58:37 -04:00
parent e1b704bdac
commit 6f39e158d6
10 changed files with 50 additions and 10 deletions

View file

@ -1288,7 +1288,10 @@ def set_user_repo_permission(username, namespace_name, repository_name,
if username == namespace_name:
raise DataModelException('Namespace owner must always be admin.')
user = User.get(User.username == username)
try:
user = User.get(User.username == username)
except User.DoesNotExist:
raise InvalidUsernameException('Invalid username: %s' % username)
return __set_entity_repo_permission(user, 'user', namespace_name,
repository_name, role_name)