Skip to content

Commit

Permalink
Do not close the dialog if the form validation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
s-simoncelli committed Feb 19, 2024
1 parent efe8d8a commit 104e23d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pywr_editor/dialogs/metadata/metadata_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ def on_form_save(self) -> None:
Save the form and close the dialog.
:return: None
"""
self.form.on_save()
self.close()
if self.form.on_save():
self.close()
4 changes: 2 additions & 2 deletions pywr_editor/dialogs/node/node_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def on_form_save(self) -> None:
Save the form and close the dialog.
:return: None
"""
self.form.save()
self.close()
if self.form.save():
self.close()


class NodeDialogTitle(QWidget):
Expand Down

0 comments on commit 104e23d

Please sign in to comment.