diff --git a/mealie/routes/users/crud.py b/mealie/routes/users/crud.py index 45a571df5..d7cfc7008 100644 --- a/mealie/routes/users/crud.py +++ b/mealie/routes/users/crud.py @@ -42,7 +42,7 @@ class UserController(BaseUserController): @user_router.put("/password") def update_password(self, password_change: ChangePassword): """Resets the User Password""" - if self.user.password == "LDAP" or self.user.auth_method == AuthMethod.LDAP: + if self.user.auth_method == AuthMethod.LDAP: raise HTTPException( status.HTTP_400_BAD_REQUEST, ErrorResponse.respond(self.t("user.ldap-update-password-unavailable")) ) diff --git a/mealie/services/user_services/password_reset_service.py b/mealie/services/user_services/password_reset_service.py index 36d403d72..cc967bf08 100644 --- a/mealie/services/user_services/password_reset_service.py +++ b/mealie/services/user_services/password_reset_service.py @@ -21,7 +21,7 @@ class PasswordResetService(BaseService): self.logger.error(f"failed to create password reset for {email=}: user doesn't exists") # Do not raise exception here as we don't want to confirm to the client that the Email doesn't exists return None - elif user.password == "LDAP" or user.auth_method == AuthMethod.LDAP: + elif user.auth_method == AuthMethod.LDAP: self.logger.error(f"failed to create password reset for {email=}: user controlled by LDAP") return None diff --git a/tests/fixtures/fixture_users.py b/tests/fixtures/fixture_users.py index 1eccf79e0..f79fa6554 100644 --- a/tests/fixtures/fixture_users.py +++ b/tests/fixtures/fixture_users.py @@ -337,7 +337,7 @@ def ldap_user(): user = db.users.create( { "username": utils.random_string(10), - "password": "mealie_password_not_important", + "password": "LDAP", "full_name": utils.random_string(10), "email": utils.random_string(10), "admin": False,