def METHOD_NAME(self):
    code = self.cleaned_data["tfa_code"]
    device = django_otp.match_token(self.user, code)
    if device is None:
        raise forms.ValidationError(_("This code is invalid"))
    return device