Skip to content

Commit 84b3d97

Browse files
committed
hotfix
1 parent c2d64bd commit 84b3d97

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

feed/services.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66

77
def delete_news_for_model(instance: SIGNALS_MODELS):
88
content_type = ContentType.objects.get_for_model(instance)
9-
obj = News.objects.filter(content_type=content_type, object_id=instance.id).first()
9+
obj = News.objects.filter(
10+
text="", content_type=content_type, object_id=instance.id
11+
).first()
1012
if obj:
1113
obj.delete()
1214

1315

1416
def create_news_for_model(instance: SIGNALS_MODELS):
1517
content_type = ContentType.objects.get_for_model(instance)
16-
News.objects.get_or_create(content_type=content_type, object_id=instance.id)
18+
News.objects.get_or_create(text="", content_type=content_type, object_id=instance.id)

0 commit comments

Comments
 (0)