diff --git a/app/models.py b/app/models.py index f9598f4a..14c1384a 100644 --- a/app/models.py +++ b/app/models.py @@ -160,7 +160,8 @@ class User(db.Model, ModelMixin, UserMixin): if password: user.set_password(password) - db.session.flush() + + db.session.flush() # create a first alias mail to show user how to use when they login GenEmail.create_new(user.id, prefix="my-first-alias") diff --git a/tests/oauth/test_authorize.py b/tests/oauth/test_authorize.py index 3620cade..196d5cca 100644 --- a/tests/oauth/test_authorize.py +++ b/tests/oauth/test_authorize.py @@ -39,8 +39,9 @@ def test_construct_url(): def test_authorize_page_non_login_user(flask_client): """make sure to display login page for non-authenticated user""" user = User.create("test@test.com", "test user") - client = Client.create_new("test client", user.id) + db.session.commit() + client = Client.create_new("test client", user.id) db.session.commit() r = flask_client.get(