cleaned up comment

This commit is contained in:
David Kennedy 2025-01-30 14:19:42 -05:00
parent 3fa9e8ec61
commit 5e89d4f652
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B

View file

@ -1407,9 +1407,12 @@ class BaseInvitationAdmin(ListHeaderAdmin):
Normal flow on successful save_model on add is to redirect to changelist_view.
If there are errors, flow is modified to instead render change form.
"""
# store current messages from request so that they are preserved throughout the method
# store current messages from request in storage so that they are preserved throughout the
# method, as some flows remove and replace all messages, and so we store here to retrieve
# later
storage = get_messages(request)
# Check if there are any error or warning messages in the `messages` framework
# Check if there are any error messages in the `messages` framework
# error messages stop the workflow; other message levels allow flow to continue as normal
has_errors = any(message.level_tag in ["error"] for message in storage)
if has_errors: