File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -252,13 +252,13 @@ def get_recordings(request: HttpRequest, public: bool | None = None):
252252 recordings = (
253253 Recording .objects .filter (public = True )
254254 .exclude (Q (owner = request .user ) | Q (spectrogram__isnull = True ))
255- .annotate (tags_text = ArrayAgg ('tags__text' ))
255+ .annotate (tags_text = ArrayAgg ('tags__text' , filter = Q ( tags__text__isnull = False ) ))
256256 .values ()
257257 )
258258 else :
259259 recordings = (
260260 Recording .objects .filter (owner = request .user )
261- .annotate (tags_text = ArrayAgg ('tags__text' ))
261+ .annotate (tags_text = ArrayAgg ('tags__text' , filter = Q ( tags__text__isnull = False ) ))
262262 .values ()
263263 )
264264
@@ -298,7 +298,9 @@ def get_recording(request: HttpRequest, id: int):
298298 # Filter recordings based on the owner's id or public=True
299299 try :
300300 recordings = (
301- Recording .objects .filter (pk = id ).annotate (tags_text = ArrayAgg ('tags__text' )).values ()
301+ Recording .objects .filter (pk = id )
302+ .annotate (tags_text = ArrayAgg ('tags__text' , filter = Q (tags__text__isnull = False )))
303+ .values ()
302304 )
303305 if len (recordings ) > 0 :
304306 recording = recordings [0 ]
You can’t perform that action at this time.
0 commit comments