diff --git a/src/registrar/admin.py b/src/registrar/admin.py index 9b842abf8..e17729cd7 100644 --- a/src/registrar/admin.py +++ b/src/registrar/admin.py @@ -1001,6 +1001,16 @@ def changelist_view(self, request, extra_context=None): # Get the filtered values return super().changelist_view(request, extra_context=extra_context) + def save_model(self, request, obj, form, change): + # Clear warning messages before saving + storage = messages.get_messages(request) + storage.used = False + for message in storage: + if message.level == messages.WARNING: + storage.used = True + + return super().save_model(request, obj, form, change) + class SeniorOfficialAdmin(ListHeaderAdmin): """Custom Senior Official Admin class."""