Skip to content

Commit

Permalink
Rename is_edu_email to more adequate now show_auto_approve
Browse files Browse the repository at this point in the history
  • Loading branch information
yarikoptic committed Oct 15, 2024
1 parent a0b467b commit ee88c24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dandiapi/api/views/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +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') or user.email.endswith(
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 ee88c24

Please sign in to comment.