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 @@ -20,8 +20,9 @@ def get_queryset_for_project(self):
2020 except Project .DoesNotExist :
2121 # TODO: raise http 404 here
2222 return News .objects .none ()
23+ # временное удаление постов для проектов с текстом
2324 return News .objects .get_news (obj = project ).exclude (
24- content_type__model = "project " , text__is = None
25+ text = " " , content_type__model = "project"
2526 )
2627
2728 def get_queryset_for_program (self ):
You can’t perform that action at this time.
0 commit comments