ModalDialogForm closes dialog on submission error

Bug #600364 reported by Forrest Aldridge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Methanal
Fix Released
High
Jonathan Jacobs

Bug Description

Because of the way the deferred callback/errback chain works (http://twistedmatrix.com/documents/current/core/howto/defer.html), adding a callback that closes the dialog in Methanal.Widgets.ModalDialogForm.submit results in that callback being invoked even when a form submission error occurs.

I believe that instead of ModalDialogForms closing without any positive or negative feedback on a form submission error, users should instead see any form submission errors that occurred and have a chance to correct the problem and resubmit the form.

One approach to fix this problem would be for M.W.ModalDialogForm.submitFailure to re-raise/throw the failure it receives in order to prevent the extra callback from ever getting invoked, but this also results in undesired behavior in that the error propagates all the way down to Athena, and an Athena error dialog is created behind the ModalDialog.

The included patch, therefore, takes a different approach. It closes the dialog from M.W.ModalDialogForm.submitSuccess instead of adding a callback in M.W.ModalDialogForm.submit.

Related branches

Revision history for this message
Forrest Aldridge (forrest-aldridge) wrote :
Changed in methanal:
importance: Undecided → High
status: New → Triaged
Changed in methanal:
assignee: nobody → Jonathan Jacobs (jjacobs)
Changed in methanal:
status: Triaged → In Progress
Changed in methanal:
milestone: none → 0.2.1
Changed in methanal:
status: In Progress → Fix Committed
Changed in methanal:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.