powerdns-admin: fix reset password

This commit is contained in:
liberodark
2026-06-22 10:44:48 +02:00
parent d48786bc65
commit 98befc7667
2 changed files with 31 additions and 0 deletions
@@ -0,0 +1,30 @@
diff --git a/powerdnsadmin/models/user.py b/powerdnsadmin/models/user.py
index 42f894f..f9d845e 100644
--- a/powerdnsadmin/models/user.py
+++ b/powerdnsadmin/models/user.py
@@ -435,7 +435,7 @@ class User(db.Model):
name='Administrator').first().id
if hasattr(self, "plain_text_password"):
- if self.plain_text_password != None:
+ if self.plain_text_password:
self.password = self.get_hashed_password(
self.plain_text_password)
else:
@@ -476,7 +476,7 @@ class User(db.Model):
# store new password hash (only if changed)
if hasattr(self, "plain_text_password"):
- if self.plain_text_password != None:
+ if self.plain_text_password:
user.password = self.get_hashed_password(
self.plain_text_password).decode("utf-8")
@@ -495,7 +495,7 @@ class User(db.Model):
user.lastname = self.lastname if self.lastname else user.lastname
if hasattr(self, "plain_text_password"):
- if self.plain_text_password != None:
+ if self.plain_text_password:
user.password = self.get_hashed_password(
self.plain_text_password).decode("utf-8")
@@ -133,6 +133,7 @@ stdenv.mkDerivation {
./0004-Fix-flask-session-and-powerdns-admin-compatibility.patch
./0005-Fix-app-context-and-register-modules.patch
./0006-Fix-regex.patch
./0008-Fix-profile-save-overwriting-password-with-empty-val.patch
];
postPatch = ''