Skip to content

Commit

Permalink
Fix user creating
Browse files Browse the repository at this point in the history
  • Loading branch information
b00bl1k committed May 20, 2024
1 parent b9a8274 commit 498e813
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion avbot/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_one_or_create(model, create_method="", create_method_kwargs=None,
created = getattr(model, create_method, model)(**kwargs)
try:
session.add(created)
session.flush()
session.commit()
return created, True
except IntegrityError:
session.rollback()
Expand Down

0 comments on commit 498e813

Please sign in to comment.