From c1ab3a7cdcd9d73e862751d410257fbe0a4fc339 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Tue, 25 Jun 2024 16:08:54 +0200 Subject: [PATCH] Cache inactive messaging providers when viewing the queue Without this, if a provider goes from active -> inactive when there are existing posts, we'd crash the view of the existing ones. --- postgresqleu/confreg/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postgresqleu/confreg/models.py b/postgresqleu/confreg/models.py index a1e9642a..15d57257 100644 --- a/postgresqleu/confreg/models.py +++ b/postgresqleu/confreg/models.py @@ -1646,7 +1646,7 @@ class ConferenceTweetQueue(models.Model): def _ensure_provider_cache(self, cache): if 'providers' not in cache: - cache['providers'] = {str(mp.id): mp for mp in MessagingProvider.objects.only('internalname').filter(active=True, conferencemessaging__conference=self.conference, conferencemessaging__broadcast=True)} + cache['providers'] = {str(mp.id): mp for mp in MessagingProvider.objects.only('internalname').filter(conferencemessaging__conference=self.conference, conferencemessaging__broadcast=True)} cache['providerclasses'] = {str(mp.id): get_messaging_class(mp.classname) for mp in cache['providers'].values()} def _display_contents(self, cache): -- 2.39.5