+
+ def is_dupe(tag):
+ if isinstance(tag, PDCounterAuthor):
+ if filter(lambda t: t.slug == tag.slug and t != tag, tags):
+ return True
+ elif isinstance(tag, PDCounterBook):
+ if filter(lambda b: b.slug == tag.slug, tags):
+ return True
+ return False
+
+ tags = filter(lambda t: not is_dupe(t), tags)
+