Skip to content

Fix form validation success url #221

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 2 commits into from
May 2, 2023

Conversation

christianwgd
Copy link
Contributor

This fixes a constellation where a view class has no get_success_url method and has the success_message class attribute set.

If return class property success_url if exists, if not return value from classes get_success_url method. If that doesn't exist return value from models get_absolute_url method.
@trco trco added the merged label May 2, 2023
@trco trco merged commit af1bda1 into trco:master May 2, 2023
@christianwgd christianwgd deleted the fix_form_validation_success_url branch May 2, 2023 17:48
aDramaQueen pushed a commit to aDramaQueen/django-bootstrap-modal-forms that referenced this pull request Nov 30, 2023
* Fix redirect of FormValidationMixin to be compliant to standard django:
If return class property success_url if exists, if not return value from classes get_success_url method. If that doesn't exist return value from models get_absolute_url method.

* Fix success url to work with all constellations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants