Skip to content

🐛 No fallback when no name #1210

@AntoLC

Description

@AntoLC

Bug Report

Users depend the informations register in their IDP can not have a name.
If it happen, we can have a case where we don't have any information about the owners or admins.

Image

To reproduce

  • Create a user without name but email
  • Create a doc
  • Invite this person as a admin or owner
  • Invite another person as a reader
  • Connect with this reader person
  • Open the doc
  • Open the modal
  • The bug is here

Possible solution

Have a fallback on full_name if it is empty :

class UserLightSerializer(UserSerializer):
"""Serialize users with limited fields."""
class Meta:
model = models.User
fields = ["full_name", "short_name"]
read_only_fields = ["full_name", "short_name"]

Ex (transform all punctuation in dash as a light obfuscation ?):

  • user_3@test.com become user-3
  • john.doe@test.com become john-doe3

Metadata

Metadata

Assignees

Labels

backendbugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions