From 5b92525cc29c1275e294de3fea775b017c6c8362 Mon Sep 17 00:00:00 2001 From: Alex de Landgraaf Date: Fri, 27 Sep 2024 16:16:22 +0200 Subject: [PATCH] Merge pull request #1414 from maykinmedia/issue/2782-first-name-edit [#2782+#2780] Disable first name editing for DigiD user with BRP --- src/open_inwoner/accounts/tests/test_profile_views.py | 4 ++++ src/open_inwoner/templates/pages/profile/edit.html | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/open_inwoner/accounts/tests/test_profile_views.py b/src/open_inwoner/accounts/tests/test_profile_views.py index 4b3c9a1ae3..2f10eace8a 100644 --- a/src/open_inwoner/accounts/tests/test_profile_views.py +++ b/src/open_inwoner/accounts/tests/test_profile_views.py @@ -463,6 +463,10 @@ def test_form_for_digid_brp_user_saves_data(self): response = self.app.get(self.url, user=user) form = response.forms["profile-edit"] + # check that first_name field is not rendered for digid_brp_user + with self.assertRaises(AssertionError): + form["first_name"] = "test" + form["email"] = "user@example.com" form["phonenumber"] = "0612345678" response = form.submit() diff --git a/src/open_inwoner/templates/pages/profile/edit.html b/src/open_inwoner/templates/pages/profile/edit.html index f5b021f821..47fd03d70c 100644 --- a/src/open_inwoner/templates/pages/profile/edit.html +++ b/src/open_inwoner/templates/pages/profile/edit.html @@ -27,7 +27,6 @@

{% input form.email %} {% input form.phonenumber %} {% elif user.is_digid_user_with_brp %} - {% input form.first_name %} {% input form.email %} {% input form.phonenumber %} {% if user.contact_type == "begeleider" %}