jazzband / django-smart-selects

chained and grouped selects for django forms
https://django-smart-selects.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.12k stars 352 forks source link

Verbose name of the ChainedManyToManyField not working in newer versions #252

Closed OndraRehounek closed 6 years ago

OndraRehounek commented 6 years ago

You MUST use this template when reporting issues. Please make sure you follow the checklist and fill in all of the information sections below.


All versions of django-smart-selects prior to version 1.2.8 are vulnerable to an XSS attack as detailed in issue 171. As a result, all previous versions have been removed from PyPI to prevent users from installing insecure versions. All users are urged to upgrade as soon as possible.

Checklist

Put an x in the bracket when you have completed each task, like this: [x]

Steps to reproduce

  1. Set verbose_name for ChainedManyToManyField (with ugettext or without)

Actual behavior

The verbose name is not used for form laberl, it shows database name of the field instead. It does work correctly for ChainedForeignKey fields. It worked with older versions (1.2.9) but after we upgraded to 1.5.3, we are experiencing quite many difficulties. It is wrong already in the init() of the form.

Expected behavior

The field label is set according to given verbose name.

city = ChainedManyToManyField(City, verbose_name=_(u'Město'), chained_field='district', chained_model_field='district', auto_choose=True, blank=True)
blag commented 6 years ago

Please try out the pass-verbose-name-through branch for me and tell me if this is fixed. Thanks!

OndraRehounek commented 6 years ago

Works perfectly, thank you for such a fast fix!

blag commented 6 years ago

Merged into master will push out a release to PyPI soon.

blag commented 6 years ago

I cut a release to PyPI and GitHub as version 1.5.4. Thanks!

blag commented 6 years ago

Sorry, was on a plane with spotty internet when I wrote that. The upload to PyPI didn't work then. I have just now successfully uploaded version 1.5.4 to PyPI:

https://pypi.python.org/pypi/django-smart-selects