mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-23 19:20:47 +02:00
Change your contact information to refer to logged-in user
This commit is contained in:
parent
d081df21ab
commit
1851f83480
2 changed files with 4 additions and 5 deletions
|
@ -1309,10 +1309,9 @@ class TestDomainDetail(TestWithDomainPermissions, WebTest):
|
|||
self.assertContains(page, "Domain contact information")
|
||||
|
||||
def test_domain_your_contact_information_content(self):
|
||||
"""Your contact information appears on the page."""
|
||||
self.domain_information.submitter = Contact(first_name="Testy")
|
||||
self.domain_information.submitter.save()
|
||||
self.domain_information.save()
|
||||
"""Logged-in user's contact information appears on the page."""
|
||||
self.user.contact.first_name = "Testy"
|
||||
self.user.contact.save()
|
||||
page = self.app.get(
|
||||
reverse("domain-your-contact-information", kwargs={"pk": self.domain.id})
|
||||
)
|
||||
|
|
|
@ -115,7 +115,7 @@ class DomainYourContactInformationView(DomainPermissionView, FormMixin):
|
|||
def get_form_kwargs(self, *args, **kwargs):
|
||||
"""Add domain_info.submitter instance to make a bound form."""
|
||||
form_kwargs = super().get_form_kwargs(*args, **kwargs)
|
||||
form_kwargs["instance"] = self.get_object().domain_info.submitter
|
||||
form_kwargs["instance"] = self.request.user.contact
|
||||
return form_kwargs
|
||||
|
||||
def get_success_url(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue