Skip to content

Commit 53b22fb

Browse files
authored
work around a type error triggered by taggit
1 parent 5fc1142 commit 53b22fb

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

reversion_compare/compare.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ def get_many_to_many(self):
152152
elif self.value is DOES_NOT_EXIST:
153153
return {}, {}, [] # TODO: refactor that
154154

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

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

0 commit comments

Comments
 (0)