dlamotte / django-tagging

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

edit_string_for_tags() returns wrong string when there is just one tag with spaces inside #225

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
If the tag list sent to edit_string_for_tags() contains just one tag, and this 
tag contains one or 
more spaces inside, the string returned will be wrong, since it lacks a 
trailing comma:

import tagging
t = tagging.models.Tag()
t.name = 'tag with spaces inside'
tagging.utils.edit_string_for_tags([t])

-> u'tag with spaces inside'

That's because edit_string_for_tags() ends with:

return glue.join(names)

Even though glue will (correctly) be ', ' when the tag contains a space inside, 
join() won't append 
a trailing glue (it only puts glue in between tags, that is, if there is more 
than one tag).

Original issue reported on code.google.com by dalember...@gmail.com on 23 Nov 2009 at 2:07

GoogleCodeExporter commented 8 years ago
This looks to be a duplicate of #184 

Original comment by winhamwr on 23 Nov 2009 at 9:34

GoogleCodeExporter commented 8 years ago
It is - and I *did* look the issue list before submitting this one... Sorry for 
the time lost.

Original comment by dalember...@gmail.com on 23 Nov 2009 at 9:37