stages/invitation: don't use uuid.hex

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-08-23 19:14:46 +02:00
parent 1419910b29
commit 2af4f28239
3 changed files with 3 additions and 3 deletions

View file

@ -17,7 +17,7 @@ def migrate_add_name(apps: Apps, schema_editor: BaseDatabaseSchemaEditor):
Invitation = apps.get_model("authentik_stages_invitation", "invitation")
for invite in Invitation.objects.using(db_alias).all():
invite.name = invite.pk.hex
invite.name = str(invite.pk)
invite.save()

View file

@ -11,7 +11,7 @@ def migrate_add_name(apps: Apps, schema_editor: BaseDatabaseSchemaEditor):
Invitation = apps.get_model("authentik_stages_invitation", "invitation")
for invite in Invitation.objects.using(db_alias).all():
invite.name = invite.pk.hex
invite.name = str(invite.pk)
invite.save()

View file

@ -81,7 +81,7 @@ class InvitationFinalStageView(StageView):
if not invitation:
self.logger.warning("InvitationFinalStageView stage called without invitation")
return HttpResponseBadRequest
token = invitation.invite_uuid.hex
token = str(invitation.invite_uuid)
if invitation.single_use:
invitation.delete()
self.logger.debug("Deleted invitation", token=token)