mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 02:44:18 +00:00
codestyle enhancements
This commit is contained in:
parent
c565b08f9c
commit
3147bed90a
@ -578,10 +578,11 @@ class User(HashidMixin, UserMixin, db.Model):
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
if 'role' not in kwargs:
|
||||
if kwargs['email'] == current_app.config['NOPAQUE_ADMIN']:
|
||||
kwargs['role'] = Role.query.filter_by(name='Administrator').first()
|
||||
else:
|
||||
kwargs['role'] = Role.query.filter_by(default=True).first()
|
||||
kwargs['role'] = (
|
||||
Role.query.filter_by(name='Administrator').first()
|
||||
if kwargs['email'] == current_app.config['NOPAQUE_ADMIN']
|
||||
else Role.query.filter_by(default=True).first()
|
||||
)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
|
Loading…
Reference in New Issue
Block a user