Skip to content

Don't close related modal if error exists #257

@ArkieCoder

Description

@ArkieCoder

Hello,

I am overriding save_model in a ModelAdmin class that is related to another class. In my save_model I am detecting if there were errors in the save process, which can happen if a user provides a malformed file to one of the fields. If there is an error, I use django.contrib.messages to display the error to the user.

The problem with using the related modal for this in my app is that the modal closes and the error message does not display. Is there a way to either 1) prevent the modal from closing if there is a message to display or 2) to force the parent page to reload if there are messages in the queue to display?

Thanks - this is a great module that radically improved the UX of my app with just a few small changes. Very much appreciated.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions