From 3f05754c99856daaa917275431a0708e13ed60dd Mon Sep 17 00:00:00 2001 From: Ernesto Rico Schmidt <ernesto@helsinki.at> Date: Thu, 7 Nov 2024 15:02:56 -0400 Subject: [PATCH] refactor: inline check if request is authenticated --- program/views.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/program/views.py b/program/views.py index 926289de..edc0b304 100644 --- a/program/views.py +++ b/program/views.py @@ -1642,9 +1642,7 @@ class APIPlaylistViewSet(viewsets.ModelViewSet): """The queryset is empty if the request is not authenticated. Otherwise, it contains all the playlists.""" - user = self.request.user - - if not user.is_authenticated: + if not self.request.user.is_authenticated: return Playlist.objects.none() return Playlist.objects.all() -- GitLab