Commit 0be68edc authored by Benjamin Fischer's avatar Benjamin Fischer
Browse files

[models] Group: reduce overhead in `get_or_create_by_name`

parent 6f25488d
......@@ -181,8 +181,7 @@ class Group(Base):
"""
group = Group.get_by_name(session, name)
if group is None:
Group.create(session, name, privacy=privacy, password=password)
group = Group.get_by_name(session, name)
group = Group.create(session, name, privacy=privacy, password=password)
return group
@staticmethod
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment