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: Hide "Remember me" checkbox when needed #126

Merged

Conversation

mvandenburgh
Copy link
Contributor

Currently, django-allauth-ui assumes that the remember BooleanField always exists on the LoginForm. However, when using the default django-allauth LoginForm, the remember field is not present when the ACCOUNT_SESSION_REMEMBER setting is set. See https://github.com/pennersr/django-allauth/blob/main/allauth/account/forms.py#L129-L130. When that setting is set, the "Remember me" label text still appears on the django-allauth-ui login page.

Screenshot from the django-allauth-ui sample project, with the ACCOUNT_SESSION_REMEMBER set to True (notice there is no checkbox next to "Remember me"):
Screenshot from 2024-12-07 12-47-29

This pull request conditionalizes the remember field in the login template to only render when LoginForm.remember exists.

@mvandenburgh mvandenburgh force-pushed the fix/hide-remember-when-needed branch from 6959662 to 5937202 Compare December 8, 2024 18:54
@mvandenburgh mvandenburgh changed the title Hide "Remember me" checkbox when needed fix: Hide "Remember me" checkbox when needed Dec 8, 2024
@danihodovic danihodovic merged commit cefb1ea into danihodovic:master Dec 9, 2024
2 of 3 checks passed
@danihodovic
Copy link
Owner

danihodovic commented Dec 9, 2024

Thank you Mike. Released as 1.5.3

https://pypi.org/project/django-allauth-ui/1.5.3/

@mvandenburgh mvandenburgh deleted the fix/hide-remember-when-needed branch December 10, 2024 00:36
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.

2 participants