dlamotte / django-tagging

Automatically exported from code.google.com/p/django-tagging
Other
0 stars 0 forks source link

Exception when FORCE_LOWERCASE_TAGS is set #259

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
A simple flow of multiple tag selection:

From user input, run utility function parse_tag_input and receive a list.

Set this list to a tag field when FORCE_LOWERCASE_TAGS is set.

method: def __set__(self, instance, value): is called

lines 70,71:

if settings.FORCE_LOWERCASE_TAGS and value is not None:
            value = value.lower()

this fails with exception since value is a list and not a string. There should 
be test for a list and lowercase the list one by one if needed.

Original issue reported on code.google.com by lior.s...@gmail.com on 2 Feb 2011 at 7:32

GoogleCodeExporter commented 8 years ago
Hi! I fixed it in tagging/models.py
line 35:

        if settings.FORCE_LOWERCASE_TAGS:
            tag_names = tag_names.lower()
        updated_tag_names = parse_tag_input(tag_names)

Original comment by s.lyapus...@gmail.com on 17 Feb 2012 at 2:11

Attachments: