CiviWiki / OpenCiviWiki

Building a Better Democracy for the Internet Age
https://civi.wiki
Other
587 stars 346 forks source link

Inconsistent Required status for First name and Last name fields in Profiles and Users classes in Admin Console #1465

Open werberger opened 1 year ago

werberger commented 1 year ago

Description

In the Admin Console, you are not able to save a Profile with empty First name or Last name.

However, you are able to save a User with name fields empty.

What should have happened?

No response

What browser(s) are you seeing the problem on?

No response

Further details

If the desired outcome is that the Profile can be saved with empty name fields then I think an easy fix may be:

class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, related_name="profile") first_name = models.CharField(max_length=63, blank=**False**) change to True last_name = models.CharField(max_length=63, blank=**False**) change to True

Or if "Anonymous" is the desired default (as I've seen mentioned), a possibly a partial solution would be to add default="Anonymous" for _firstname and change blank to True as above. However, this would still mean that _firstname would be required, of course.

ilaiyengar commented 1 year ago

Hi, I am a first time contributor! Would this be a good first issue that I can assist with?

brylie commented 1 year ago

@werberger may want to claim this issue.

werberger commented 1 year ago

yeah. thanks @brylie and sorry @ilaiyengar - if it's any consolation it will also be my first contribution.

Nehemiah60 commented 1 year ago

Hello, @brylie. Kindly assign me this