diff --git a/otpauth/models.py b/otpauth/models.py index 5b17913..1b86f33 100644 --- a/otpauth/models.py +++ b/otpauth/models.py @@ -1,9 +1,8 @@ from django.db import models from django.contrib.auth.models import AbstractUser - from rest_framework import exceptions from rest_framework import authentication -from otpauth.serializer import TokenSerializer + class OTPSeed(AbstractUser): id = models.AutoField(primary_key=True) @@ -17,6 +16,8 @@ class OTPSeed(AbstractUser): def __str__(self): return "'{}'@{}".format(self.name, self.realm) +from otpauth.serializer import TokenSerializer + class OTPAuthentication(authentication.BaseAuthentication): def authenticate(self, request): serializer = TokenSerializer(data=request.data)