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

✨(backend) add full_name and short_name to user model and API #301

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

sampaccoud
Copy link
Contributor

Purpose

We need to add a name for our users instead of showing their email addresses.

Proposal

Add a short_name and full_name fields as per the best international practice.

The full_name and short_name field are synchronized with the OIDC token upon each login. The fields from the token that are synchronized with the the short_name and full_name fields are configurable (in our case firstname + lastname goes to full_name, while first_name goes to short_name)

@sampaccoud sampaccoud requested a review from AntoLC October 2, 2024 17:05
@sampaccoud sampaccoud self-assigned this Oct 2, 2024
@sampaccoud sampaccoud added enhancement New feature or request python Pull requests that update Python code backend labels Oct 2, 2024
@sampaccoud sampaccoud force-pushed the add-name-to-user branch 2 times, most recently from ea07469 to ae036dd Compare October 2, 2024 17:12
Copy link
Collaborator

@AntoLC AntoLC left a comment

Choose a reason for hiding this comment

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

Top!

Can we add the names here as well, with names can be sometime empty?

queue.push(
models.User(
admin_email=f"user{i:d}@example.com",
email=f"user{i:d}@example.com",
password="!",
is_superuser=False,
is_active=True,
is_staff=False,
language=random.choice(settings.LANGUAGES)[0],
)
)

@AntoLC AntoLC linked an issue Oct 3, 2024 that may be closed by this pull request
@sampaccoud sampaccoud enabled auto-merge (rebase) October 3, 2024 21:18
The full_name and short_name field are synchronized with the OIDC
token upon each login.
@sampaccoud sampaccoud merged commit eee2003 into main Oct 3, 2024
16 of 17 checks passed
@sampaccoud sampaccoud deleted the add-name-to-user branch October 3, 2024 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend enhancement New feature or request python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨(backend) Add user name to User table
2 participants