Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tagulous and django-model-utils FieldTracker NoneType comparison #23

Open
apollodatasolutions opened this issue Feb 3, 2017 · 3 comments

Comments

@apollodatasolutions
Copy link

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?

@dkdndes
Copy link

dkdndes commented Jun 17, 2018

I am sure Radiac will be very motivated if you combine it if you sponsor his time ;-)

@apollodatasolutions
Copy link
Author

We wouldn't be opposed to contributing if we can get an estimate on how much it would cost. :)

@radiac
Copy link
Owner

radiac commented Jun 17, 2018

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants