Skip to content
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

Fix case sensitivity issue in username handling #1146

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docker-app/qfieldcloud/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,12 @@ def before_send(event, hint):
# Choose one of "mandatory", "optional", or "none".
# For local development and test use "optional" or "none"
ACCOUNT_EMAIL_VERIFICATION = os.environ.get("ACCOUNT_EMAIL_VERIFICATION")
ACCOUNT_PRESERVE_USERNAME_CASING = False

# This setting determines whether the username is stored in lowercase (False) or whether its casing is to be preserved (True).
# Note that when casing is preserved, potentially expensive __iexact lookups are performed when filter on username.
# For now, the default is set to True to maintain backwards compatibility.
# See https://docs.allauth.org/en/dev/account/configuration.html
ACCOUNT_PRESERVE_USERNAME_CASING = True
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ACCOUNT_PRESERVE_USERNAME_CASING = True
# This setting determines whether the username is stored in lowercase (False) or whether its casing is to be preserved (True).
# Note that when casing is preserved, potentially expensive __iexact lookups are performed when filter on username.
# For now, the default is set to True to maintain backwards compatibility.
# See https://docs.allauth.org/en/dev/account/configuration.html
ACCOUNT_PRESERVE_USERNAME_CASING = True

ACCOUNT_USERNAME_REQUIRED = True
ACCOUNT_ADAPTER = "qfieldcloud.core.adapters.AccountAdapter"
ACCOUNT_LOGOUT_ON_GET = True
Expand Down
Loading