Skip to content

Commit

Permalink
Merge pull request #86 from Athemis/taggit_workaround
Browse files Browse the repository at this point in the history
Work around a type error triggered by taggit
  • Loading branch information
jedie authored Dec 6, 2017
2 parents de914eb + 53b22fb commit 5b183e7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion reversion_compare/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ def get_many_to_many(self):
elif self.value is DOES_NOT_EXIST:
return {}, {}, [] # TODO: refactor that

ids = frozenset(map(force_text, self.value))
try:
ids = frozenset(map(force_text, self.value))
except(TypeError):
# catch errors e.g. produced by taggit's TaggableManager
return {}, {}, [] # TODO: refactor that

# Get the related model of the current field:
return self.get_many_to_something(ids, self.field.rel.to)
Expand Down

0 comments on commit 5b183e7

Please sign in to comment.