collective / collective.elephantvocabulary

zope vocabulary with possibility to hide/show terms
http://pypi.python.org/pypi/collective.elephantvocabulary
GNU General Public License v2.0
1 stars 0 forks source link

Internal terms lists get nested when updated from registry #3

Open lukasgraf opened 11 years ago

lukasgraf commented 11 years ago

In vocabulary.py:56 and vocabulary.py:76 the internal lists VocabularyFactory.visible_terms and VocabularyFactory.hidden_terms get updated with values from the registry.

However, because lst.append() is used instead of lst.extend(), this causes those lists to get nested:

>>> hidden_terms = [1, 2, 3]
>>> hidden_terms.append([4, 5, 6])
>>> hidden_terms
[1, 2, 3, [4, 5, 6]]
garbas commented 11 years ago

i'm currently at plone conference in brasil, but i'll look into fixing this asap.

as always patched and test welcome :)

lukasgraf commented 11 years ago

Oh, of course - have fun! I unfortunately couldn't make it. I added tests and a fix for this in #4