stages/invitation: remove invitation from plan context after deletion

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-11-02 23:50:12 +01:00
parent cb64eed90d
commit f978575293
1 changed files with 5 additions and 3 deletions

View File

@ -79,7 +79,9 @@ class InvitationFinalStageView(StageView):
if not invitation: if not invitation:
LOGGER.warning("InvitationFinalStageView stage called without invitation") LOGGER.warning("InvitationFinalStageView stage called without invitation")
return HttpResponseBadRequest return HttpResponseBadRequest
if not invitation.single_use: token = invitation.invite_uuid.hex
return self.executor.stage_ok() if invitation.single_use:
invitation.delete() invitation.delete()
LOGGER.debug("Deleted invitation", token=token)
del self.executor.plan.context[INVITATION]
return self.executor.stage_ok() return self.executor.stage_ok()