From df8fc43323c6487b750340ee51cfaf64f3401b28 Mon Sep 17 00:00:00 2001 From: Petitminion Date: Tue, 6 Jun 2023 15:23:33 +0200 Subject: [PATCH] do not mix the radios --- api/funkwhale_api/radios/radios.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/api/funkwhale_api/radios/radios.py b/api/funkwhale_api/radios/radios.py index ead3a99ab..0c0ba2efa 100644 --- a/api/funkwhale_api/radios/radios.py +++ b/api/funkwhale_api/radios/radios.py @@ -80,18 +80,14 @@ class SessionRadio(SimpleRadio): def get_choices(self, **kwargs): kwargs.update(self.get_queryset_kwargs()) - if self.session and cache.get( - f"radioqueryset{self.__class__.__name__}{self.session.session_key}" - ): + if self.session and cache.get(f"radioqueryset{self.session.id}"): logger.info("Using redis cache for radio generation") - queryset = cache.get( - f"radioqueryset{self.__class__.__name__}{self.session.session_key}" - ) + queryset = cache.get(f"radioqueryset{self.session.id}") elif self.session: queryset = self.get_queryset(**kwargs) logger.info("Setting redis cache for radio generation") cache.set( - f"radioqueryset{self.__class__.__name__}{self.session.session_key}", + f"radioqueryset{self.session.id}", queryset, 3600, )