Skip to content

Conversation

Marishka17
Copy link
Contributor

@Marishka17 Marishka17 commented Jul 9, 2025

Motivation and context

This PR fixes an issue where a user cannot log in if they were invited to an organization using an email address with uppercase letters, but then manually registered using the same email address in lowercase.

This issue occurs when the CVAT server is configured with required email verification (ACCOUNT_EMAIL_VERIFICATION = "mandatory"). There is a bug in dj_rest_auth when django allauth version is < 0.62 is used. The old django allauth versions do not "normalize" emails during registration, but use register-independent email filtration. That means if an EmailAddress (from django allauth) is created in another register than User.email -> dj_rest_auth raises an exception (email is not verified).

FYI, starting from version 0.62.0, django-allauth changed how it stores and manages email addresses. In the latest version, email addresses are converted to lowercase during registration, while a case-sensitive search is used during login.
Documentation: https://docs.allauth.org/en/latest/account/email.html
Related changes: pennersr/django-allauth@4bb94eb

How has this been tested?

manually

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • I have linked related issues (see GitHub docs)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

@Marishka17 Marishka17 requested a review from SpecLad as a code owner July 9, 2025 16:44
@codecov-commenter
Copy link

codecov-commenter commented Jul 9, 2025

Codecov Report

Attention: Patch coverage is 71.42857% with 8 lines in your changes missing coverage. Please review.

Project coverage is 71.96%. Comparing base (89704ed) to head (97dcb80).
Report is 5 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9629      +/-   ##
===========================================
+ Coverage    71.76%   71.96%   +0.20%     
===========================================
  Files          441      441              
  Lines        46374    46359      -15     
  Branches      3960     3960              
===========================================
+ Hits         33279    33362      +83     
+ Misses       13095    12997      -98     
Components Coverage Δ
cvat-ui 77.72% <ø> (+0.02%) ⬆️
cvat-server 67.39% <71.42%> (+0.34%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Marishka17 Marishka17 changed the title Delegate EmailAddress creation to allauth [WIP] Delegate EmailAddress creation to allauth Jul 10, 2025
@Marishka17 Marishka17 changed the title [WIP] Delegate EmailAddress creation to allauth Delegate EmailAddress creation to allauth Jul 10, 2025
@Marishka17 Marishka17 force-pushed the mk/fix_login_issue branch from 73c993a to 05f174e Compare July 14, 2025 15:35
@Marishka17 Marishka17 force-pushed the mk/fix_login_issue branch from 10f70aa to 583a03d Compare July 15, 2025 11:34
@Marishka17 Marishka17 requested a review from nmanovic as a code owner July 15, 2025 15:19
@Marishka17 Marishka17 force-pushed the mk/fix_login_issue branch from 020bb43 to 97dcb80 Compare July 16, 2025 10:31
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots

See analysis details on SonarQube Cloud

@Marishka17 Marishka17 merged commit 862c994 into develop Jul 16, 2025
37 of 38 checks passed
@Marishka17 Marishka17 deleted the mk/fix_login_issue branch July 16, 2025 13:44
@cvat-bot cvat-bot bot mentioned this pull request Jul 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.

3 participants