X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/5b9ee3437b7fa98820eba7286abd524c3ede76e9..f82c33291d3bf97d7447aba236940bdfe560f703:/apps/newtagging/models.py diff --git a/apps/newtagging/models.py b/apps/newtagging/models.py index ead442f31..694f5b868 100644 --- a/apps/newtagging/models.py +++ b/apps/newtagging/models.py @@ -71,7 +71,7 @@ class TagManager(models.Manager): if tag not in current_tags: self.intermediary_table_model._default_manager.create(tag=tag, content_object=obj) - tags_updated.send(sender=obj, affected_tags=tags_to_add + tags_for_removal) + tags_updated.send(sender=type(obj), instance=obj, affected_tags=tags_to_add + tags_for_removal) def remove_tag(self, obj, tag): """ @@ -179,7 +179,7 @@ class TaggedItemManager(models.Manager): if not tags: return queryset.none() # TODO: presumes reverse generic relation - return queryset.filter(tag_relations__tag__in=tags) + return queryset.filter(tag_relations__tag__in=tags).distinct() def get_related(self, obj, queryset_or_model): """