-
Notifications
You must be signed in to change notification settings - Fork 17
Add institutional email verification feature #2295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 9 out of 11 changed files in this pull request and generated 2 comments.
Files not reviewed (2)
- dandiapi/api/templates/api/account/questionnaire_form.html: Language not supported
- dandiapi/api/templates/api/mail/verification_email.txt: Language not supported
Comments suppressed due to low confidence (1)
dandiapi/api/models/user.py:21
- The institutional_email field defaults to an empty string while the migration allows null; aligning these settings can prevent potential inconsistencies.
institutional_email = models.EmailField(blank=True, default='')
| token_age = datetime.datetime.now(tz=datetime.UTC) - created_time | ||
| if token_age.total_seconds() > TOKEN_EXPIRATION_SECONDS: |
Copilot
AI
Apr 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider replacing 'datetime.UTC' with 'datetime.timezone.utc' to ensure correct timezone usage.
| token_age = datetime.datetime.now(tz=datetime.UTC) - created_time | |
| if token_age.total_seconds() > TOKEN_EXPIRATION_SECONDS: | |
| token_age = datetime.datetime.now(tz=datetime.timezone.utc) - created_time |
| verification_url = f"{settings.DANDI_API_URL}{reverse('verify-email')}?token={token}" | ||
|
|
||
| # Set the token creation time | ||
| user.metadata.verification_token_created = datetime.datetime.now(tz=datetime.UTC) |
Copilot
AI
Apr 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace 'datetime.UTC' with 'datetime.timezone.utc' for proper timezone handling in token creation.
| user.metadata.verification_token_created = datetime.datetime.now(tz=datetime.UTC) | |
| user.metadata.verification_token_created = datetime.datetime.now(tz=datetime.timezone.utc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ruff wanted it the other way. I have no preference
fix #1967
Cline-assisted