Skip to content

Commit

Permalink
Merge pull request #2044 from dandi/auto-allen
Browse files Browse the repository at this point in the history
Auto-allow people with @alleninstitute.org email addresses
  • Loading branch information
mvandenburgh authored Oct 15, 2024
2 parents b239530 + ee88c24 commit 03fad7b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dandiapi/api/views/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,13 @@ def user_questionnaire_form_view(request: HttpRequest) -> HttpResponse:
not questionnaire_already_filled_out
and user_metadata.status == UserMetadata.Status.INCOMPLETE
):
is_edu_email: bool = user.email.endswith('.edu')
should_auto_approve: bool = user.email.endswith('.edu') or user.email.endswith(
'@alleninstitute.org'
)

# auto-approve users with edu emails, otherwise require manual approval
user_metadata.status = (
UserMetadata.Status.APPROVED if is_edu_email else UserMetadata.Status.PENDING
UserMetadata.Status.APPROVED if should_auto_approve else UserMetadata.Status.PENDING
)
user_metadata.save(update_fields=['status'])

Expand Down

0 comments on commit 03fad7b

Please sign in to comment.