diff --git a/pkgs/by-name/po/powerdns-admin/0008-Fix-profile-save-overwriting-password-with-empty-val.patch b/pkgs/by-name/po/powerdns-admin/0008-Fix-profile-save-overwriting-password-with-empty-val.patch new file mode 100644 index 000000000000..22479605cd90 --- /dev/null +++ b/pkgs/by-name/po/powerdns-admin/0008-Fix-profile-save-overwriting-password-with-empty-val.patch @@ -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") diff --git a/pkgs/by-name/po/powerdns-admin/package.nix b/pkgs/by-name/po/powerdns-admin/package.nix index ad085252faba..8fed4e899f41 100644 --- a/pkgs/by-name/po/powerdns-admin/package.nix +++ b/pkgs/by-name/po/powerdns-admin/package.nix @@ -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 = ''