mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-23 19:20:47 +02:00
fix notifications on analyst action
This commit is contained in:
parent
84c30f69ee
commit
bc80c13bd3
1 changed files with 14 additions and 10 deletions
|
@ -174,16 +174,20 @@ class DomainFormBaseView(DomainBaseView, FormMixin):
|
|||
}
|
||||
|
||||
is_analyst_action = ("analyst_action" in self.session and "analyst_action_location" in self.session)
|
||||
should_notify=False
|
||||
|
||||
if form.__class__ in form_label_dict and not is_analyst_action:
|
||||
# these types of forms can cause notifications
|
||||
should_notify = True
|
||||
if form.__class__ in check_for_portfolio:
|
||||
# some forms shouldn't cause notifications if they are in a portfolio
|
||||
info = self.get_domain_info_from_domain()
|
||||
if not info or info.portfolio:
|
||||
logger.debug("No notification sent: Domain is part of a portfolio")
|
||||
should_notify = False
|
||||
if form.__class__ in form_label_dict:
|
||||
if is_analyst_action:
|
||||
logger.debug("No notification sent: Action was conducted by an analyst")
|
||||
else:
|
||||
# these types of forms can cause notifications
|
||||
should_notify = True
|
||||
if form.__class__ in check_for_portfolio:
|
||||
# some forms shouldn't cause notifications if they are in a portfolio
|
||||
info = self.get_domain_info_from_domain()
|
||||
if not info or info.portfolio:
|
||||
logger.debug("No notification sent: Domain is part of a portfolio")
|
||||
should_notify = False
|
||||
else:
|
||||
# don't notify for any other types of forms
|
||||
should_notify = False
|
||||
|
@ -202,7 +206,7 @@ class DomainFormBaseView(DomainBaseView, FormMixin):
|
|||
)
|
||||
else:
|
||||
logger.info(
|
||||
f"Not notifying for {form.__class__}, form changes: {form.has_changed()}, force_send: {force_send}"
|
||||
f"No notification sent for {form.__class__}. form changes: {form.has_changed()}, force_send: {force_send}"
|
||||
)
|
||||
|
||||
def email_domain_managers(self, domain: Domain, template: str, subject_template: str, context={}):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue