@@ -49,7 +49,6 @@ class Meta:
4949 "created_at" : ("exact" , "gt" , "gte" , "lt" , "lte" ),
5050 "start" : ("exact" , "gt" , "gte" , "lt" , "lte" ),
5151 "end" : ("exact" , "gt" , "gte" , "lt" , "lte" ),
52- "is_stood_down" : ("exact" ,),
5352 "molnix_id" : ("exact" , "in" ),
5453 "message" : ("exact" , "in" ),
5554 "country" : ("exact" , "in" ),
@@ -67,7 +66,7 @@ class SurgeAlertViewset(viewsets.ReadOnlyModelViewSet):
6766 authentication_classes = (TokenAuthentication ,)
6867 queryset = SurgeAlert .objects .prefetch_related ("molnix_tags" , "molnix_tags__groups" ).select_related ("event" , "country" ).all ()
6968 filterset_class = SurgeAlertFilter
70- ordering_fields = ("created_at" , "atype" , "category" , "event" , "is_stood_down" , " molnix_status" , "opens" )
69+ ordering_fields = ("created_at" , "atype" , "category" , "event" , "molnix_status" , "opens" )
7170 search_fields = (
7271 "operation" ,
7372 "message" ,
@@ -80,6 +79,10 @@ def get_serializer_class(self):
8079 # return UnauthenticatedSurgeAlertSerializer
8180 return SurgeAlertSerializer
8281
82+ def get_queryset (self ):
83+ queryset = self .get_queryset ()
84+ return queryset .filter (molnix_id__isnull = False ).exclude (molnix_tags__name = "NO_GO" )
85+
8386
8487# def get_queryset(self):
8588# # limit = 14 # days
0 commit comments