电子邮件api验证中的keyerror

时间:2019-01-09 12:02:33

标签: django

在项目中,我正在/ rest-auth / registration / verify-email /

遇到错误KeyError
def get_object(self, queryset=None):
    key = self.kwargs('key')
    emailconfirmation = EmailConfirmationHMAC.from_key(key)
    if not emailconfirmation:
        if queryset is None:
            queryset = self.get_queryset()
        try:
            emailconfirmation = queryset.get(key=key.lower())
        except EmailConfirmation.DoesNotExist:
            raise Http404()
    return emailconfirmation

0 个答案:

没有答案