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

Use preferred names for templates in Tock #1167

Merged
merged 9 commits into from
Jan 29, 2021
Merged

Use preferred names for templates in Tock #1167

merged 9 commits into from
Jan 29, 2021

Conversation

Jkrzy
Copy link
Contributor

@Jkrzy Jkrzy commented Sep 1, 2020

Description

For #1027, we now render preferred names (First + Last) -- configurable via the admin panel -- for all pages in Tock.

This does not include changes to the API endpoints or data exports.

There's a handful of users (~9) who don't have a First/Last name value set -- We could handled with a bit more code here, rendering username as a fallback OR updating these users in the admin.

We should also update the Tock change form so folks can request a name update...OR create a form so folks can update it themselves

Jkrzy and others added 3 commits September 1, 2020 10:39
Using django's provided `user.get_full_name` we now render
full name, configurable in the admin, for display throughout Tock.
Also removing duplicated test
`hours.test.test_views.test_project_timeline`
@codecov-io
Copy link

codecov-io commented Jan 22, 2021

Codecov Report

Merging #1167 (459b764) into main (1d2cf42) will decrease coverage by 0.71%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1167      +/-   ##
==========================================
- Coverage   88.93%   88.22%   -0.72%     
==========================================
  Files          51       51              
  Lines        2097     2097              
==========================================
- Hits         1865     1850      -15     
- Misses        232      247      +15     
Impacted Files Coverage Δ
hours/views.py 83.97% <0.00%> (-4.46%) ⬇️
projects/views.py 97.36% <0.00%> (ø)
utilization/unit.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1d2cf42...c0985d9. Read the comment docs.

tock/utilization/unit.py Outdated Show resolved Hide resolved
Since we're using UserData to get a display name,
let's get them all on our first query instead each one
individually.
@Jkrzy
Copy link
Contributor Author

Jkrzy commented Jan 29, 2021

:amaze: Thanks @Sgtpluck! I added a one line tweak to avoid some extra queries AND I can't approve this since I'm the original author 😅.

Take a look at 836cb80 and 👍 👎 please. This change lets us render the Out of Office project with ~11 queries instead of ~350 (one for each employee)

Copy link
Contributor

@tbaxter-18f tbaxter-18f left a comment

Choose a reason for hiding this comment

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

Big round of 👏 for @Sgtpluck. Great job, especially as you're still learning your way around Django.

@tbaxter-18f tbaxter-18f merged commit 0b037bf into main Jan 29, 2021
@Jkrzy Jkrzy deleted the jbk/names branch January 29, 2021 19:54
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