fix: 修复禁用 MFA 后还可以用 MFA 查看密码匣子

This commit is contained in:
xinwen
2021-02-25 07:44:06 +08:00
committed by 老广
parent 8ec26dea43
commit 4c4f544f0d
2 changed files with 14 additions and 0 deletions

10
apps/users/exceptions.py Normal file
View File

@@ -0,0 +1,10 @@
from django.utils.translation import gettext_lazy as _
from rest_framework import status
from common.exceptions import JMSException
class MFANotEnabled(JMSException):
status_code = status.HTTP_403_FORBIDDEN
default_code = 'mfa_not_enabled'
default_detail = _('MFA not enabled')