fix: 调整confirm (#8554)

Co-authored-by: feng626 <1304903146@qq.com>
This commit is contained in:
fit2bot
2022-07-07 17:07:57 +08:00
committed by GitHub
parent 1b4d389f2b
commit bf7c05f753
3 changed files with 5 additions and 3 deletions

View File

@@ -18,7 +18,9 @@ class ConfirmType(TextChoices):
@classmethod
def get_can_confirm_types(cls, confirm_type):
start = cls.values.index(confirm_type)
return cls.values[start:]
types = cls.values[start:]
types.reverse()
return types
@classmethod
def get_can_confirm_backend_classes(cls, confirm_type):

View File

@@ -7,4 +7,4 @@ from ..const import ConfirmType, MFAType
class ConfirmSerializer(serializers.Serializer):
confirm_type = serializers.ChoiceField(required=True, allow_blank=True, choices=ConfirmType.choices)
mfa_type = serializers.ChoiceField(required=False, allow_blank=True, choices=MFAType.choices)
secret_key = EncryptedField()
secret_key = EncryptedField(allow_blank=True)