🐛 fix(utils.py): remove unnecessary password verification when creating a superuser

💡 refactor(utils.py): simplify logic for creating a superuser by removing redundant password verification
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-10-04 14:51:18 -03:00
commit 203929914e

View file

@ -47,7 +47,7 @@ def get_or_create_super_user(session: Session, username, password, is_default):
user = session.query(User).filter(User.username == username).first()
if user and user.is_superuser and verify_password(password, user.password):
if user and user.is_superuser:
return None # Superuser already exists
if user and is_default: