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

TOM-TOOLKIT incompatible with Django==4.2 #628

Closed
jchate6 opened this issue Apr 14, 2023 · 1 comment · Fixed by #629
Closed

TOM-TOOLKIT incompatible with Django==4.2 #628

jchate6 opened this issue Apr 14, 2023 · 1 comment · Fixed by #629
Assignees
Labels
bug Something isn't working dependencies Pull requests that update a dependency file

Comments

@jchate6
Copy link
Contributor

jchate6 commented Apr 14, 2023

Allowing Django==4.2 causes the test tom_common.tests.TestUserManagement.test_user_can_update_self to fail.
We should look into this if we want to allow for newer versions of Django.

@jchate6 jchate6 added bug Something isn't working dependencies Pull requests that update a dependency file labels Apr 14, 2023
@jchate6
Copy link
Contributor Author

jchate6 commented Apr 17, 2023

According to the 4.2 Release notes:
"UserCreationForm now rejects usernames that differ only in case. If you need the previous behavior, use BaseUserCreationForm instead."

Replacing UserCreationForm with BaseUserCreationForm in tom_common.forms.CustomUserCreationForm resolves this issue.

The failure was happening in that the form was found to be invalid with the error A user with that username already exists.
In the test, the username is identical in the update, and shouldn't trigger this error since it's being done as part of an update, not a new object. I think the issue is using a UserCreationForm to perform an update rather than creating an entirely new user, but I'm not sure why the BaseUserCreationForm wouldn't care about this.

@jchate6 jchate6 linked a pull request Apr 19, 2023 that will close this issue
@jchate6 jchate6 self-assigned this Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant