Add a failure message when there is no EPP connection

This commit is contained in:
zandercymatics 2023-10-10 11:41:34 -06:00
parent e6c44b2d9b
commit f334e516f1
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -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()