From 2a01e025ec95bd536268c18a2df65cb5c99ed56f Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 24 Mar 2019 11:54:38 +0100 Subject: [PATCH] Flush session instead of committing when creating a new user --- newuser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newuser.py b/newuser.py index 334cc500..ed283997 100644 --- a/newuser.py +++ b/newuser.py @@ -6,7 +6,7 @@ user = session.query(db.Royal).filter_by(username=username).one_or_none() if user is None: user = db.Royal.create(session, username) session.add(user) -session.commit() +session.flush() try: steam = db.Steam.create(session, user.id, input("Steam ID 1: ")) except Exception as e: