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

Use different function name for dismissing "add" popup when necessary #75

Merged

Conversation

vxsx
Copy link
Contributor

@vxsx vxsx commented Apr 21, 2016

Django 1.8 introduced a change of the function name from
dismissAddAnotherPopup to dismissAddRelatedObjectPopup. Old name was
kept for backwards compatibility, but since it's value is now a
reference and not an actual function, sortedm2m overrides only that
reference and not the actual dismissAddRelatedObjectPopup which is
now the function being called in
django/contrib/admin/templates/admin/popup_response.html. Since django
no longer calls the overridden function, the added object would only
appear after refresh.

This pull request makes it compatible with django 1.8+.

Ref: django/django@0798874#diff-ec17958cc9f7c2542303557dfc4ad997R130

Django 1.8 introduced a change of the function name from
`dismissAddAnotherPopup` to `dismissAddRelatedObjectPopup`. Old name was
kept for backwards compatibility, but since it's value is now a
reference and not an actual function, sortedm2m overrides only that
reference and not the actual `dismissAddRelatedObjectPopup` which is
now the function being called in
`django/contrib/admin/templates/admin/popup_response.html`. Since django
no longer calls the overridden function, the added object would only
appear after refresh.

Ref: django/django@0798874#diff-ec17958cc9f7c2542303557dfc4ad997R130
@gregmuellegger gregmuellegger merged commit 99a3ad6 into jazzband:master Apr 21, 2016
@gregmuellegger
Copy link
Collaborator

Cool! Good catch. Thanks for your efforts.

gregmuellegger added a commit that referenced this pull request Apr 21, 2016
@vxsx
Copy link
Contributor Author

vxsx commented Apr 21, 2016

Thank you!

@gregmuellegger
Copy link
Collaborator

Released a new version containing the fix: https://pypi.python.org/pypi/django-sortedm2m

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