Require a full name — first and last — on every account #2

Closed
opened 2026-09-05 11:47:13 +00:00 by tiagoagueda · 0 comments
Owner

Observation

a full name (it can be separated as first and last name) both obligatory

What happens today

first_name and last_name are inherited from AbstractUser and are optional (blank=True). They are not collected at signup (ACCOUNT_SIGNUP_FIELDS in src/postulo/config/settings/base.py asks only for email and password), and the profile form (src/postulo/accounts/forms.py, ProfileForm) declares both with required=False.

The consequence is visible on documents: contact_details() in src/postulo/documents/rendering.py prints get_full_name() or display_name, so an account without a name gets the email local part at the top of its CV — during M3 a rendered CV read operator as the candidate's name. Making the name obligatory removes that failure mode. seed_demo papers over it by inventing a name only when the fields are empty.

What changes

  • Collect first and last name at signup. allauth's signup form needs a custom form (ACCOUNT_FORMS = {"signup": …}) or an adapter hook to add fields beyond the built-in set.
  • Invite acceptance goes through the same form, so it is covered.
  • ProfileForm: both fields required=True.
  • Decide the level of enforcement (see questions). If it is the database — blank=False — a data migration must supply values for existing rows, which is what makes this breaking.
  • Wiki: Getting started ("fill in your details") and Accounts and invitations.

Why this is a breaking change

Existing accounts can have empty names — the local development database and the test instance on ragnar both do. A hard requirement on a populated table needs a migration and a decision about what to write into it.

Open questions

  1. Two fields or one? The observation allows either; two fields keep get_full_name() and the CV header working unchanged.
  2. Enforce in the database (blank=False, needs a backfill) or only in the forms (no migration, but the model still admits an empty name from the admin or the import)?
  3. What existing accounts without a name should be given — a placeholder to be corrected on next sign-in, or a forced profile completion step?

Related: username identification and mandatory email verification are filed separately.

## Observation > a full name (it can be separated as first and last name) both obligatory ## What happens today `first_name` and `last_name` are inherited from `AbstractUser` and are **optional** (`blank=True`). They are not collected at signup (`ACCOUNT_SIGNUP_FIELDS` in `src/postulo/config/settings/base.py` asks only for email and password), and the profile form (`src/postulo/accounts/forms.py`, `ProfileForm`) declares both with `required=False`. The consequence is visible on documents: `contact_details()` in `src/postulo/documents/rendering.py` prints `get_full_name() or display_name`, so an account without a name gets the email local part at the top of its CV — during M3 a rendered CV read **operator** as the candidate's name. Making the name obligatory removes that failure mode. `seed_demo` papers over it by inventing a name only when the fields are empty. ## What changes - Collect first and last name at signup. allauth's signup form needs a custom form (`ACCOUNT_FORMS = {"signup": …}`) or an adapter hook to add fields beyond the built-in set. - Invite acceptance goes through the same form, so it is covered. - `ProfileForm`: both fields `required=True`. - Decide the level of enforcement (see questions). If it is the database — `blank=False` — a data migration must supply values for existing rows, which is what makes this breaking. - Wiki: *Getting started* ("fill in your details") and *Accounts and invitations*. ## Why this is a breaking change Existing accounts can have empty names — the local development database and the test instance on ragnar both do. A hard requirement on a populated table needs a migration and a decision about what to write into it. ## Open questions 1. Two fields or one? The observation allows either; two fields keep `get_full_name()` and the CV header working unchanged. 2. Enforce in the database (`blank=False`, needs a backfill) or only in the forms (no migration, but the model still admits an empty name from the admin or the import)? 3. What existing accounts without a name should be given — a placeholder to be corrected on next sign-in, or a forced profile completion step? Related: username identification and mandatory email verification are filed separately.
tiagoagueda added this to the 0.2.0 milestone 2026-09-05 11:47:13 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Postulo/postulo#2
No description provided.