We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c2d64bd commit 84b3d97Copy full SHA for 84b3d97
1 file changed
feed/services.py
@@ -6,11 +6,13 @@
6
7
def delete_news_for_model(instance: SIGNALS_MODELS):
8
content_type = ContentType.objects.get_for_model(instance)
9
- obj = News.objects.filter(content_type=content_type, object_id=instance.id).first()
+ obj = News.objects.filter(
10
+ text="", content_type=content_type, object_id=instance.id
11
+ ).first()
12
if obj:
13
obj.delete()
14
15
16
def create_news_for_model(instance: SIGNALS_MODELS):
17
- 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