Skip to content

Change FormMixin.success_url to _StrOrPromise #2769

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

Merged
merged 1 commit into from
Aug 12, 2025

Conversation

pgcd
Copy link
Contributor

@pgcd pgcd commented Aug 12, 2025

I have made things!

Update django.views.generic.edit.FormMixin.success_url to _StrOrPromise | None, to allow using reverse_lazy() as attribute value.

Related issues

Closes #2768

@pgcd pgcd marked this pull request as draft August 12, 2025 07:41
Update `django.views.generic.edit.FormMixin.success_url` and
`django.views.generic.edit.DeletionMixin.success_url`
to `_StrOrPromise | None`, to allow using `reverse_lazy()`
as attribute value.

Fixes #typeddjango#2768
@pgcd pgcd force-pushed the formmixin-success-url-promise branch from d316dae to 5937d87 Compare August 12, 2025 07:50
@pgcd pgcd marked this pull request as ready for review August 12, 2025 07:50
Copy link
Member

@ngnpope ngnpope left a comment

Choose a reason for hiding this comment

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

Thanks!

I suspect that there are some other URL-related attributes that would benefit from the same. I'll follow up on that.

@ngnpope ngnpope merged commit 2c860e5 into typeddjango:master Aug 12, 2025
37 checks passed
@ngnpope ngnpope mentioned this pull request Aug 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

FormMixin.success_url should allow for StrPromise
2 participants