Skip to content

Add email as a potentially missing field#14

Merged
CannonLock merged 1 commit intomainfrom
optional-oidc-email
Apr 20, 2026
Merged

Add email as a potentially missing field#14
CannonLock merged 1 commit intomainfrom
optional-oidc-email

Conversation

@CannonLock
Copy link
Copy Markdown
Member

Handle the instance where external collaborators don't have emails at their user info endpoint and we need to collect that information another way.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the user/application-form data model to support users (notably external/OIDC collaborators) who may not have an email available at the user-info endpoint, by allowing email to be captured via the user application form and stored in the DB/view.

Changes:

  • Make users.email1 nullable and adjust Pydantic schemas accordingly.
  • Add an email field to UserForm (table + schemas) and to the user_applications view/model.
  • Update form submission/approval flow and add tests covering “user without email” scenarios.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
userapp/core/schemas/users.py Makes email1 optional in user read/table schemas to reflect nullable DB column.
userapp/core/schemas/user_application_form.py Adds email to user application form post/patch/get/table schemas.
userapp/core/schemas/general.py Adds email to the UserApplicationView schema (view response shape).
userapp/core/models/tables.py Makes User.email1 nullable and adds UserForm.email column.
userapp/core/models/views.py Adds email column to the UserApplicationView ORM mapping.
userapp/api/routes/security.py Avoids KeyError when OIDC userinfo has no email and removes debug print.
userapp/api/routes/forms/user_application.py Persists email on form creation and changes trigger invocation to pass the created form.
userapp/api/routes/forms/_util.py Uses form-provided email when user has no email; sets user email on approval.
alembic/versions/cf94844cecc1_allow_email1_to_be_nullable.py Migration to add user_form.email, make users.email1 nullable, and recreate user_applications view.
userapp/api/tests/test_forms.py Adds test coverage for submitting/approving forms when the user has no email1.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread userapp/api/routes/forms/_util.py Outdated
Comment thread userapp/api/routes/forms/_util.py
Comment thread userapp/api/tests/test_forms.py
Comment thread userapp/api/tests/test_forms.py
Comment thread userapp/core/models/tables.py
Comment thread userapp/core/schemas/general.py Outdated
Comment thread alembic/versions/cf94844cecc1_allow_email1_to_be_nullable.py Outdated
Comment thread alembic/versions/cf94844cecc1_allow_email1_to_be_nullable.py Outdated
Comment thread userapp/api/tests/test_forms.py
Comment thread userapp/api/tests/test_forms.py
Handle the instance where external collaborators don't have emails at their user info endpoint and we need to collect that information another way.
@CannonLock CannonLock force-pushed the optional-oidc-email branch from 071da86 to f24990f Compare April 20, 2026 21:07
@CannonLock CannonLock merged commit 1f9b858 into main Apr 20, 2026
1 check passed
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.

2 participants