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 form action URL in user edit and delete views for custom user models #11951

Merged
merged 2 commits into from
May 13, 2024

Conversation

laymonage
Copy link
Member

@laymonage laymonage commented May 13, 2024

I was working on adding UserViewSet customisation support, then I encountered this issue...

83e7930 mistakenly removed the context_object_name from the EditView and DeleteView. Since the view still uses the custom templates that render the form action with a {% url %} instead of the available edit_url context variable, this results in the template being rendered with the current user as the user that is used to generate the URL. This only applies to installations where the auth user model's model_name is not user, so the bakerydemo is not affected.

@laymonage laymonage added this to the 6.1.1 milestone May 13, 2024
@laymonage laymonage requested a review from gasman May 13, 2024 12:35
@laymonage laymonage self-assigned this May 13, 2024
Copy link

squash-labs bot commented May 13, 2024

Manage this branch in Squash

Test this branch here: https://laymonagefix-user-edit-url-nejhg.squash.io

Copy link
Collaborator

@gasman gasman left a comment

Choose a reason for hiding this comment

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

Good catch!

@gasman gasman merged commit 3689290 into wagtail:main May 13, 2024
18 checks passed
gasman pushed a commit that referenced this pull request May 13, 2024
…els (#11951)

* Add test for the form action URL in the user edit and delete views

* Reinstate context_object_name in users EditView and DeleteView

Mistakenly removed in 83e7930
gasman added a commit that referenced this pull request May 13, 2024
gasman added a commit that referenced this pull request May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants