

def _validate_second_factor_legacy(self):
    try:
        obj = self.user.backup_codes.get(code=self.cleaned_data['code'])
    except BackupCode.DoesNotExist:
        self.add_error('code', self.INVALID_ERROR_MESSAGE)
        return False
    obj.delete()
    return True

dataset/ETHPy150Open gavinwahl/django-u2f/django_u2f/forms.py BackupCodeForm._validate_second_factor_legacy/original