eric6/Preferences/ConfigurationPages/MasterPasswordEntryDialog.py

changeset 8222
5994b80b8760
parent 8218
7c09585bd960
diff -r 0572a215bd2f -r 5994b80b8760 eric6/Preferences/ConfigurationPages/MasterPasswordEntryDialog.py
--- a/eric6/Preferences/ConfigurationPages/MasterPasswordEntryDialog.py	Sun Apr 11 16:53:48 2021 +0200
+++ b/eric6/Preferences/ConfigurationPages/MasterPasswordEntryDialog.py	Sun Apr 11 18:45:10 2021 +0200
@@ -61,11 +61,13 @@
             enable = False
             error = error or self.tr("Repeated password is wrong.")
         
-        if self.currentPasswordEdit.isEnabled():
-            if self.newPasswordEdit.text() == self.currentPasswordEdit.text():
-                enable = False
-                error = error or self.tr(
-                    "Old and new password must not be the same.")
+        if (
+            self.currentPasswordEdit.isEnabled() and
+            self.newPasswordEdit.text() == self.currentPasswordEdit.text()
+        ):
+            enable = False
+            error = error or self.tr(
+                "Old and new password must not be the same.")
         
         self.buttonBox.button(
             QDialogButtonBox.StandardButton.Ok).setEnabled(enable)

eric ide

mercurial