outposts: fix error when controller loads from cache but cache has expired

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-05-15 17:45:33 +02:00
parent 8925787a13
commit 1745306cc6
1 changed files with 2 additions and 0 deletions

View File

@ -100,6 +100,8 @@ def outpost_controller(
outpost: Outpost = cache.get(CACHE_KEY_OUTPOST_DOWN % outpost_pk)
else:
outpost: Outpost = Outpost.objects.get(pk=outpost_pk)
if not outpost:
return
self.set_uid(slugify(outpost.name))
try:
controller = controller_for_outpost(outpost)