codestyle enhancements

This commit is contained in:
Patrick Jentsch 2023-02-24 10:34:42 +01:00
parent c565b08f9c
commit 3147bed90a

View File

@ -578,10 +578,11 @@ class User(HashidMixin, UserMixin, db.Model):
def __init__(self, **kwargs): def __init__(self, **kwargs):
if 'role' not in kwargs: if 'role' not in kwargs:
if kwargs['email'] == current_app.config['NOPAQUE_ADMIN']: kwargs['role'] = (
kwargs['role'] = Role.query.filter_by(name='Administrator').first() Role.query.filter_by(name='Administrator').first()
else: if kwargs['email'] == current_app.config['NOPAQUE_ADMIN']
kwargs['role'] = Role.query.filter_by(default=True).first() else Role.query.filter_by(default=True).first()
)
super().__init__(**kwargs) super().__init__(**kwargs)
def __repr__(self): def __repr__(self):