1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 11:34:18 +00:00

Flush session instead of committing when creating a new user

This commit is contained in:
Steffo 2019-03-24 11:54:38 +01:00
parent b501960fed
commit 2a01e025ec

View file

@ -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: