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

tiny fix on newuser.py

This commit is contained in:
Steffo 2018-03-21 21:17:34 +01:00
parent d673b55f30
commit fbe1c78399
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: C27544372FBB445D

View file

@ -1,7 +1,10 @@
import db
session = db.Session()
user = db.Royal.create(session, input("Nome account: "))
username = input("Nome account: ")
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()
try: