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

Distinguish between given and display name for users #1903

Merged
merged 2 commits into from
Jun 5, 2023

Conversation

emdiso
Copy link
Contributor

@emdiso emdiso commented Mar 15, 2023

made requested changes from: #1895

  • removed requested files
  • removed endpoint making a manual database entry
  • removed edit display name modal
  • changed the profile page table to a form, except for the CC users part which is simply shown below the form
  • disabled all form fields except for display name
  • added display_name field to staff user form as well
  • added logic to profile_edit function in /evaluation/views.py to save changes

let me know if it all looks ok. very new to Django :)

keywords: first_name_given, first_name_chosen, choose name, custom first name.

@richardebeling richardebeling changed the title Updates to PR #1895 Add display_name to UserProfile Mar 17, 2023
@richardebeling richardebeling linked an issue Mar 17, 2023 that may be closed by this pull request
Copy link
Member

@janno42 janno42 left a comment

Choose a reason for hiding this comment

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

Good work on the form! Again, I'm sorry this is so much work in your first PR but I'm glad you found a good solution!
There are a few more thing to address though. Please let us know if you need any further information.

evap/evaluation/forms.py Outdated Show resolved Hide resolved
evap/evaluation/forms.py Outdated Show resolved Hide resolved
evap/evaluation/forms.py Outdated Show resolved Hide resolved
evap/evaluation/tests/test_views.py Outdated Show resolved Hide resolved
package-lock.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
evap/contributor/tests/test_views.py Outdated Show resolved Hide resolved
evap/evaluation/templates/profile.html Show resolved Hide resolved
evap/staff/forms.py Show resolved Hide resolved
@emdiso
Copy link
Contributor Author

emdiso commented Mar 26, 2023 via email

Copy link
Member

@janno42 janno42 left a comment

Choose a reason for hiding this comment

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

The test works fine for me. Actually, it sends a GET request (self.app.get) and then checks for text within the rendered page. Thus, the email field is filled and the user's email can be found on the page. So you can remove the comment and everything should be working :)

@janno42
Copy link
Member

janno42 commented Mar 29, 2023

I didn't do a complete final review yet, but there should only be minor things, if any.

Copy link
Member

@janno42 janno42 left a comment

Choose a reason for hiding this comment

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

✔️ Meets requirements
✔️ UI functionality checked

evap/evaluation/forms.py Outdated Show resolved Hide resolved
Copy link
Member

@richardebeling richardebeling left a comment

Choose a reason for hiding this comment

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

Hey, thanks for working on this!

In an offline discussion, @janno42 and me found a few more spots that need to be changed that we forgot to list in the issue. I've added annotations for these starting with "(follow-up)". In order to not bloat the scope of this PR, we'd say its fine to ignore these for now, merge this pull request, and then create a follow up issue for these. However, if you'd already like to fix some of them here, you're also very welcome to do so.

In general, we much appreciate the work so far, and in case you don't have time to keep working on this, we're also happy to take over and implement the remaining changes ourselves. Just give us a small ping in this case, so we know we can go ahead.

evap/evaluation/forms.py Outdated Show resolved Hide resolved
evap/evaluation/forms.py Outdated Show resolved Hide resolved
evap/evaluation/tests/test_views.py Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
evap/evaluation/forms.py Outdated Show resolved Hide resolved
evap/evaluation/models.py Show resolved Hide resolved
evap/staff/tools.py Outdated Show resolved Hide resolved
evap/evaluation/models.py Show resolved Hide resolved
evap/evaluation/views.py Show resolved Hide resolved
evap/evaluation/models.py Outdated Show resolved Hide resolved
@richardebeling richardebeling force-pushed the main branch 2 times, most recently from 1f030ce to 8450180 Compare May 8, 2023 19:11
@janno42 janno42 self-requested a review May 15, 2023 15:53
Copy link
Member

@janno42 janno42 left a comment

Choose a reason for hiding this comment

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

✔️ Meets requirements
✔️ UI functionality checked

@richardebeling richardebeling dismissed their stale review May 15, 2023 17:53

Fixed the issues

Copy link
Member

@niklasmohrin niklasmohrin left a comment

Choose a reason for hiding this comment

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

some comments (to be continued)

@@ -2071,7 +2071,7 @@ def user_list(request):
"ccing_users",
"courses_responsible_for",
)
.order_by("last_name", "first_name", "email")
.order_by(*UserProfile._meta.ordering)
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be automatic?

Copy link
Member

Choose a reason for hiding this comment

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

for some weird reason, it isn't -- but I haven't invested the time to find out why. Probably due to the complex query building above?

evap/results/tools.py Outdated Show resolved Hide resolved
evap/evaluation/management/commands/anonymize.py Outdated Show resolved Hide resolved
Copy link
Member

@niklasmohrin niklasmohrin left a comment

Choose a reason for hiding this comment

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

Looks mostly good, some nits. Haven't thought about whether there are more places yet

evap/evaluation/models.py Outdated Show resolved Hide resolved
evap/evaluation/models.py Outdated Show resolved Hide resolved
evap/evaluation/tests/test_views.py Outdated Show resolved Hide resolved
evap/evaluation/views.py Outdated Show resolved Hide resolved
evap/evaluation/views.py Outdated Show resolved Hide resolved
evap/evaluation/templates/profile.html Outdated Show resolved Hide resolved
Copy link
Member

@niklasmohrin niklasmohrin left a comment

Choose a reason for hiding this comment

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

Looks good

evap/evaluation/templates/profile.html Outdated Show resolved Hide resolved
@richardebeling richardebeling merged commit 70930d4 into e-valuation:main Jun 5, 2023
@richardebeling
Copy link
Member

Hey @emdiso, just pinging to let you know that we finally got to merge this, so your changes are now officially part of EvaP :) Thanks again for providing the initial code here 👍

@richardebeling richardebeling changed the title Add display_name to UserProfile Distinguish between given and display name for users Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Display name for UserProfiles
5 participants