From bdbbebab769ec401fa8bb3286f8af1b51159fc37 Mon Sep 17 00:00:00 2001 From: Aaron3S Date: Wed, 20 Nov 2024 17:50:46 +0800 Subject: [PATCH] feat: perf face capture page --- apps/authentication/mixins.py | 2 +- .../authentication/face_capture.html | 28 ++++++------------- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/apps/authentication/mixins.py b/apps/authentication/mixins.py index c00335ec0..92b49f64e 100644 --- a/apps/authentication/mixins.py +++ b/apps/authentication/mixins.py @@ -238,7 +238,7 @@ class MFAFaceMixin: if not self.is_context_success(context): msg = context.get('error_message', '') - raise RuntimeError("Face recognition failed,{}".format(msg)) + raise RuntimeError(msg) face_code = context.get('face_code') if not face_code: diff --git a/apps/authentication/templates/authentication/face_capture.html b/apps/authentication/templates/authentication/face_capture.html index 4d0f66096..f04716a59 100644 --- a/apps/authentication/templates/authentication/face_capture.html +++ b/apps/authentication/templates/authentication/face_capture.html @@ -2,28 +2,18 @@ {% load i18n %} {% load static %} - {% block content %} - - {% if 'code' in form.errors %} -

{{ form.code.errors.as_text }}

+
+

{{ form.code.errors.as_text }}

+
{% endif %} + +