From d9ee4ffc80fc304bc8ef016bacf1df0f771a789b Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sun, 30 Dec 2018 19:02:34 +0100 Subject: [PATCH] Move tokenserializer import after otpseed definition --- otpauth/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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)