mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-05-17 18:09:25 +02:00
Remove endpoint for email content
We don't really need this. We can just store the email content on the DOM. There is no real performance impact -- its not a lot of content in the grand scheme of things and we'd just be doing a lot of api calls anyway
This commit is contained in:
parent
5ae8df2bdb
commit
abc9fb78bc
7 changed files with 36 additions and 44 deletions
|
@ -1,6 +1,7 @@
|
|||
from __future__ import annotations
|
||||
from typing import Union
|
||||
import logging
|
||||
import json
|
||||
|
||||
from django.apps import apps
|
||||
from django.conf import settings
|
||||
|
@ -1220,6 +1221,15 @@ class DomainRequest(TimeStampedModel):
|
|||
|
||||
return True
|
||||
|
||||
def get_all_action_needed_reason_emails_as_json(self):
|
||||
"""Returns a json dictionary of every action needed reason and its associated email
|
||||
for this particular domain request."""
|
||||
emails = {}
|
||||
for action_needed_reason in self.ActionNeededReasons:
|
||||
enum_value = action_needed_reason.value
|
||||
emails[enum_value] = self.get_action_needed_reason_default_email_text(enum_value)
|
||||
return json.dumps(emails)
|
||||
|
||||
def get_action_needed_reason_default_email_text(self, action_needed_reason: str):
|
||||
"""Returns the default email associated with the given action needed reason"""
|
||||
if action_needed_reason is None or action_needed_reason == self.ActionNeededReasons.OTHER:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue