Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#2782+#2780] Disable first name editing for DigiD user with BRP #1414

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

pi-sigma
Copy link
Contributor

Users should not be able to edit their first name in OIP if the Hall Centraal API is configured to pull data from BRP

Taiga: https://taiga.maykinmedia.nl/project/open-inwoner/issue/2782 and https://taiga.maykinmedia.nl/project/open-inwoner/issue/2780

@codecov-commenter
Copy link

codecov-commenter commented Sep 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.89%. Comparing base (2835a28) to head (27c047f).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1414   +/-   ##
========================================
  Coverage    94.89%   94.89%           
========================================
  Files         1046     1046           
  Lines        38610    38612    +2     
========================================
+ Hits         36638    36640    +2     
  Misses        1972     1972           
Flag Coverage Δ
94.89% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pi-sigma
Copy link
Contributor Author

@alextreme

There was indeed a mistake in our form + template. However, our logic is generally based on assumptions that are a bit at odds with the description in the Taiga issue:

  • Our code displays/hides certain things based on whether data has been retrieved from BRP. We check for the field is_prepopulated on the user model, which is set by update_brp_data_in_db. As you can see from the second, the field is only set to True if the API request is successful. Otherwise, the fields remains False (the default) and we will still show first_name in the profile edit.

    def is_digid_user_with_brp(self) -> bool:

    def update_brp_data_in_db(user, initial=True):

  • The taiga issue(s) state that first_name should be gone as soon as the API service is configured, irrespective of whether data has been requested or if the request was successful.

The latter would require a few more changes.

@pi-sigma pi-sigma marked this pull request as ready for review September 27, 2024 10:03
@pi-sigma pi-sigma changed the title [#2782] Disable first name editing for DigiD user with BRP [#2782+#2780] Disable first name editing for DigiD user with BRP Sep 27, 2024
    - Users should not be able to edit their first name in OIP
      if the Hall Centraal API is configured to pull data from
      BRP
@alextreme alextreme merged commit f0aedc1 into develop Sep 27, 2024
20 checks passed
@alextreme alextreme deleted the issue/2782-first-name-edit branch September 27, 2024 14:16
swrichards pushed a commit that referenced this pull request Sep 30, 2024
[#2782+#2780] Disable first name editing for DigiD user with BRP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants