bootstrap-uploadprogress icon indicating copy to clipboard operation
bootstrap-uploadprogress copied to clipboard

Messages returned by django are not seen by user

Open bblough opened this issue 8 years ago • 0 comments

Since the response is fetched via XHR and discarded after the upload is successful, any flash messages set by django on a successful upload are never seen by the user.

I think fixing this would require a bunch of stuff that would be complicated and unnecessary. However, I thought it might be helpful to document the behavior and a possible workaround, in case others experience the issue.

To workaround the issue, pass an empty messages list to the view renderer - status = 200 return render(request, self.template_name, {'messages': []}, status=status)

The discarded response will contain the empty message list, while the messages in message queue will be untouched. Then, after the redirect, any messages in the message queue will be displayed normally.

bblough avatar Jun 08 '16 21:06 bblough