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

[#2684] Remove/replace display_name (roepnaam) #1362

Merged
merged 3 commits into from
Aug 26, 2024

Conversation

jiromaykin
Copy link
Contributor

@codecov-commenter
Copy link

codecov-commenter commented Aug 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.20%. Comparing base (a430792) to head (013fe47).
Report is 21 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1362      +/-   ##
===========================================
+ Coverage    95.19%   95.20%   +0.01%     
===========================================
  Files         1002     1005       +3     
  Lines        37029    37169     +140     
===========================================
+ Hits         35248    35388     +140     
  Misses        1781     1781              

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

@jiromaykin jiromaykin marked this pull request as ready for review August 20, 2024 15:22
@jiromaykin
Copy link
Contributor Author

@pi-sigma This was much more back-end than I expected, so hopefully I didn't remove too much from the tests...
I'm mostly replacing display_name with first_name,
but we also used to have have a short_name here and there, so not sure if we should bring that back again to revert the change from #1270 .

@@ -367,7 +360,7 @@ def get_short_name(self):

@property
def call_name(self):
return self.display_name or self.first_name
return self.first_name or self.first_name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"return a or a" is redundant. Context: I introduced call_name to show either the display_name or the first_name, in case the display_name was not set. Now that we're getting rid of the model field display_name, I suggest renaming the propery to "display_name" and return the first name for now. If some municipalities decide they want to display user names in a different way, we can easily customize it:

@property
def display_name(self)
    return self.first_name

You'll need to change it in profile/me.html as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pi-sigma Ah yes, but I removed the Display name field from there completely, since it already has a separate field for first name. Or does this mean we need to use display_name everywhere instead of the first_name? Like in me.html, mydata.html and edit.html?

src/open_inwoner/accounts/tests/test_profile_views.py Outdated Show resolved Hide resolved
@jiromaykin jiromaykin force-pushed the issue/2684-remove-display-name branch 2 times, most recently from c98015e to af7276e Compare August 22, 2024 10:14
@jiromaykin jiromaykin force-pushed the issue/2684-remove-display-name branch from 2aa9aa7 to 64dd234 Compare August 22, 2024 10:47
@jiromaykin
Copy link
Contributor Author

@pi-sigma I think this looks good now, thanks 😊

@alextreme alextreme merged commit 2cca561 into develop Aug 26, 2024
18 checks passed
@alextreme alextreme deleted the issue/2684-remove-display-name branch August 26, 2024 08:15
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.

4 participants