Skip to content

Commit a04fe32

Browse files
committed
no text fix
1 parent 3da6d14 commit a04fe32

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

feed/views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from django.contrib.contenttypes.models import ContentType
2+
from django.db.models import Q
23
from rest_framework.generics import CreateAPIView
34
from rest_framework.response import Response
45
from rest_framework.views import APIView
@@ -32,7 +33,8 @@ def get_queryset(self):
3233
.filter(content_type__model__in=filters)
3334
.order_by("-datetime_created")
3435
)
35-
return queryset
36+
# временное удаление постов для проектов с текстом
37+
return queryset.exclude(~Q(text=""), content_type__model="project")
3638

3739
def get(self, *args, **kwargs):
3840
paginator = self.pagination_class()

news/mixins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def get_queryset_for_project(self):
2121
# TODO: raise http 404 here
2222
return News.objects.none()
2323
return News.objects.get_news(obj=project).exclude(
24-
content_type__model="project", text__is=None
24+
text="", content_type__model="project"
2525
)
2626

2727
def get_queryset_for_program(self):

0 commit comments

Comments
 (0)