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:
parent
8925787a13
commit
1745306cc6
|
@ -100,6 +100,8 @@ def outpost_controller(
|
||||||
outpost: Outpost = cache.get(CACHE_KEY_OUTPOST_DOWN % outpost_pk)
|
outpost: Outpost = cache.get(CACHE_KEY_OUTPOST_DOWN % outpost_pk)
|
||||||
else:
|
else:
|
||||||
outpost: Outpost = Outpost.objects.get(pk=outpost_pk)
|
outpost: Outpost = Outpost.objects.get(pk=outpost_pk)
|
||||||
|
if not outpost:
|
||||||
|
return
|
||||||
self.set_uid(slugify(outpost.name))
|
self.set_uid(slugify(outpost.name))
|
||||||
try:
|
try:
|
||||||
controller = controller_for_outpost(outpost)
|
controller = controller_for_outpost(outpost)
|
||||||
|
|
Reference in New Issue