Skip to content

Commit

Permalink
feat(domain setting): use verified list of domains on sending domain …
Browse files Browse the repository at this point in the history
…settings page
  • Loading branch information
andrewleith committed Dec 12, 2024
1 parent 27f5e4c commit 21f0d5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion app/main/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,11 @@ def __init__(self, *args, **kwargs):


class SendingDomainForm(StripWhitespaceForm):
sending_domain = StringField(_l("Sending domain"), validators=[])
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.sending_domain.choices = kwargs["sending_domain_choices"]

sending_domain = SelectField(_l("Sending domain"), validators=[])


class RenameOrganisationForm(StripWhitespaceForm):
Expand Down
3 changes: 2 additions & 1 deletion app/main/views/service_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
email_safe,
get_logo_cdn_domain,
get_new_default_reply_to_address,
get_verified_ses_domains,
user_has_permissions,
user_is_gov_user,
user_is_platform_admin,
Expand Down Expand Up @@ -549,7 +550,7 @@ def service_set_reply_to_email(service_id):
@main.route("/services/<service_id>/service-settings/sending-domain", methods=["GET", "POST"])
@user_is_platform_admin
def service_sending_domain(service_id):
form = SendingDomainForm()
form = SendingDomainForm(sending_domain_choices=get_verified_ses_domains())

if request.method == "GET":
form.sending_domain.data = current_service.sending_domain
Expand Down

0 comments on commit 21f0d5b

Please sign in to comment.