stages/authenticator_duo: fix imported Duo Device not having a name

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-07-28 21:19:21 +02:00
parent e14798dcdc
commit ade2d4879c
2 changed files with 5 additions and 2 deletions

View file

@ -111,7 +111,10 @@ class AuthenticatorDuoStageViewSet(UsedByMixin, ModelViewSet):
if device:
return Response(data={"non_field_errors": ["device exists already"]}, status=400)
DuoDevice.objects.create(
duo_user_id=request.query_params.get("duo_user_id"), user=user, stage=stage
duo_user_id=request.query_params.get("duo_user_id"),
user=user,
stage=stage,
name="Imported Duo Authenticator",
)
return Response(status=204)

View file

@ -83,7 +83,7 @@ class AuthenticatorDuoStageView(ChallengeStageView):
self.request.session.pop(SESSION_KEY_DUO_ACTIVATION_CODE)
if not existing_device:
DuoDevice.objects.create(
name="Duo Device",
name="Duo Authenticator",
user=self.get_pending_user(),
duo_user_id=user_id,
stage=stage,