From f334e516f1aaeded8d3b87aa7fdee551c0ef5659 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Tue, 10 Oct 2023 11:41:34 -0600 Subject: [PATCH] Add a failure message when there is no EPP connection --- src/registrar/views/domain.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/registrar/views/domain.py b/src/registrar/views/domain.py index 276895799..f30014269 100644 --- a/src/registrar/views/domain.py +++ b/src/registrar/views/domain.py @@ -306,6 +306,15 @@ class DomainSecurityEmailView(DomainPermissionView, FormMixin): domain = self.get_object() contact = domain.security_contact + + # If no default is created for security_contact, + # then we cannot connect to EPPLib. + if contact is None: + messages.error( + self.request, "Update failed. Cannot contact the registry." + ) + return redirect(self.get_success_url()) + contact.email = new_email contact.save()