Skip to content

Conversation

@bendichter
Copy link
Member

fix #1967

Cline-assisted

@bendichter bendichter requested a review from Copilot April 8, 2025 20:52
Copy link

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.

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='')

Comment on lines +47 to +48
token_age = datetime.datetime.now(tz=datetime.UTC) - created_time
if token_age.total_seconds() > TOKEN_EXPIRATION_SECONDS:
Copy link

Copilot AI Apr 8, 2025

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
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)
Copy link

Copilot AI Apr 8, 2025

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.

Suggested change
user.metadata.verification_token_created = datetime.datetime.now(tz=datetime.UTC)
user.metadata.verification_token_created = datetime.datetime.now(tz=datetime.timezone.utc)

Copilot uses AI. Check for mistakes.
Copy link
Member Author

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

@waxlamp waxlamp self-assigned this Dec 29, 2025
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.

include institution email on registration

4 participants