mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-16 17:47:02 +02:00
Readonly on send
This commit is contained in:
parent
bac9dc94aa
commit
58605f11e5
3 changed files with 48 additions and 16 deletions
|
@ -1742,8 +1742,11 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
|||
# Since this check occurs after save, if the user enters a value then
|
||||
# we won't update.
|
||||
reason_changed = obj.action_needed_reason != original_obj.action_needed_reason
|
||||
if reason_changed and default_email == obj.action_needed_reason_email:
|
||||
obj.action_needed_reason_email = default_email
|
||||
if reason_changed:
|
||||
request.session["action_needed_email_sent"] = True
|
||||
logger.info("added session object")
|
||||
if default_email == obj.action_needed_reason_email:
|
||||
obj.action_needed_reason_email = default_email
|
||||
|
||||
# == Handle status == #
|
||||
if obj.status == original_obj.status:
|
||||
|
@ -1953,6 +1956,12 @@ class DomainRequestAdmin(ListHeaderAdmin, ImportExportModelAdmin):
|
|||
extra_context["action_needed_reason_emails"] = self.get_all_action_needed_reason_emails_as_json(obj)
|
||||
extra_context["has_profile_feature_flag"] = flag_is_active(request, "profile_feature")
|
||||
|
||||
# Denote if an action needed email was sent or not
|
||||
email_sent = request.session.get("action_needed_email_sent", False)
|
||||
extra_context["action_needed_email_sent"] = email_sent
|
||||
if email_sent:
|
||||
email_sent = request.session["action_needed_email_sent"] = False
|
||||
|
||||
# Call the superclass method with updated extra_context
|
||||
return super().change_view(request, object_id, form_url, extra_context)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue