File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from django .contrib .contenttypes .models import ContentType
2+ from django .db .models import Q
23from rest_framework .generics import CreateAPIView
34from rest_framework .response import Response
45from 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 ()
Original file line number Diff line number Diff 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 ):
You can’t perform that action at this time.
0 commit comments