Move tokenserializer import after otpseed definition

This commit is contained in:
Nico Schottelius 2018-12-30 19:02:34 +01:00
parent dabe6a08ac
commit d9ee4ffc80

View file

@ -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)