You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use Tagulous as well as Django Model Utils's FieldTracker
FieldTracker checks which fields have changed as a model instance is saved, which we use for revision logging. FieldTracker offers a has_changed method to see if a field has changed in a save() operation. That function compares the field instance before and after a model instance save() operation. However, for a newly created model instance, the first instance of the field will be None. So has_changed compares None to a new Tag instance. Tagulous _eq function (in class BaseTagRelatedManager(object) in django-tagulous/tagulous/models/managers.py) doesn't account for this case, which raises a TypeError 'NoneType' object is not iterable in other_tags = [six.text_type(tag).lower() for tag in other].
Would be great if we can add a check in there for this case so it plays together more nicely with other Django apps?
The text was updated successfully, but these errors were encountered:
Thanks for the offer! Unfortunately between work and family, the main issue for me at the moment is lack of time. Hoping to get back to this soon though, to tick off some of these outstanding issues - especially this one with such a comprehensive report, thanks!
We use Tagulous as well as Django Model Utils's FieldTracker
FieldTracker checks which fields have changed as a model instance is saved, which we use for revision logging. FieldTracker offers a
has_changed
method to see if a field has changed in asave()
operation. That function compares the field instance before and after a model instancesave()
operation. However, for a newly created model instance, the first instance of the field will be None. Sohas_changed
comparesNone
to a new Tag instance. Tagulous_eq
function (inclass BaseTagRelatedManager(object)
indjango-tagulous/tagulous/models/managers.py
) doesn't account for this case, which raises aTypeError 'NoneType' object is not iterable
inother_tags = [six.text_type(tag).lower() for tag in other]
.Would be great if we can add a check in there for this case so it plays together more nicely with other Django apps?
The text was updated successfully, but these errors were encountered: