diff --git a/helios_auth/auth_systems/password.py b/helios_auth/auth_systems/password.py index 88aa1038d..48bd2df38 100644 --- a/helios_auth/auth_systems/password.py +++ b/helios_auth/auth_systems/password.py @@ -20,9 +20,12 @@ def create_user(username, password, name = None): from helios_auth.models import User - - user = User.get_by_type_and_id('password', username) - if user: + + try: + User.get_by_type_and_id('password', username) + except User.DoesNotExist: + pass + else: raise Exception('user exists') info = {'password' : password, 'name': name}