mirror of https://github.com/jumpserver/jumpserver
Merge pull request #14684 from jumpserver/pr@dev@feat_refresh_cache_facelive
feat: refresh facelive cachepull/14685/head
commit
0e0be618e5
|
@ -228,16 +228,20 @@ class FaceMonitorCallbackApi(CreateAPIView):
|
|||
face_codes = serializer.validated_data.get('face_codes')
|
||||
|
||||
if not user:
|
||||
context.save()
|
||||
return Response(data={'msg': 'user {} not found'
|
||||
.format(context.user_id)}, status=400)
|
||||
|
||||
if not self._check_face_codes(face_codes, user):
|
||||
if not face_codes or not self._check_face_codes(face_codes, user):
|
||||
context.save()
|
||||
return Response(data={'msg': 'face codes not matched'}, status=400)
|
||||
|
||||
if action == FaceMonitorActionChoices.Pause:
|
||||
context.pause_sessions()
|
||||
if action == FaceMonitorActionChoices.Resume:
|
||||
context.resume_sessions()
|
||||
|
||||
context.save()
|
||||
return Response(status=200)
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Reference in New Issue