You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: