mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-07-10 14:43:18 +00:00
codestyle enhancements
This commit is contained in:
@ -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):
|
||||||
|
Reference in New Issue
Block a user