From 3147bed90acdd9a7321479274352a3b6d589760d Mon Sep 17 00:00:00 2001
From: Patrick Jentsch
Date: Fri, 24 Feb 2023 10:34:42 +0100
Subject: [PATCH] codestyle enhancements
---
app/models.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/app/models.py b/app/models.py
index df992ccb..2800e767 100644
--- a/app/models.py
+++ b/app/models.py
@@ -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):