outposts: fix service account's permissions being checked twice
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
d7fdca1b44
commit
90ecb1af7f
|
@ -100,7 +100,7 @@ def outpost_controller(
|
||||||
if from_cache:
|
if from_cache:
|
||||||
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.filter(pk=outpost_pk).first()
|
||||||
if not outpost:
|
if not outpost:
|
||||||
return
|
return
|
||||||
self.set_uid(slugify(outpost.name))
|
self.set_uid(slugify(outpost.name))
|
||||||
|
@ -148,10 +148,7 @@ def outpost_post_save(model_class: str, model_pk: Any):
|
||||||
return
|
return
|
||||||
|
|
||||||
if isinstance(instance, Outpost):
|
if isinstance(instance, Outpost):
|
||||||
LOGGER.debug("Ensuring token and permissions for outpost", instance=instance)
|
LOGGER.debug("Trigger reconcile for outpost", instance=instance)
|
||||||
_ = instance.token
|
|
||||||
_ = instance.user
|
|
||||||
LOGGER.debug("Trigger reconcile for outpost")
|
|
||||||
outpost_controller.delay(instance.pk)
|
outpost_controller.delay(instance.pk)
|
||||||
|
|
||||||
if isinstance(instance, (OutpostModel, Outpost)):
|
if isinstance(instance, (OutpostModel, Outpost)):
|
||||||
|
|
Reference in New Issue