Fix BaseCodeTokenModel and user attr.
This commit is contained in:
parent
9534ff49bb
commit
776f040624
2 changed files with 5 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
# Generated by Django 2.0.3 on 2018-04-07 21:51
|
||||
# Generated by Django 2.0.3 on 2018-04-13 19:34
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
|
@ -130,8 +130,6 @@ class Client(models.Model):
|
|||
|
||||
class BaseCodeTokenModel(models.Model):
|
||||
|
||||
user = models.ForeignKey(
|
||||
settings.AUTH_USER_MODEL, verbose_name=_(u'User'), on_delete=models.CASCADE)
|
||||
client = models.ForeignKey(Client, verbose_name=_(u'Client'), on_delete=models.CASCADE)
|
||||
expires_at = models.DateTimeField(verbose_name=_(u'Expiration Date'))
|
||||
_scope = models.TextField(default='', verbose_name=_(u'Scopes'))
|
||||
|
@ -159,6 +157,8 @@ class BaseCodeTokenModel(models.Model):
|
|||
|
||||
class Code(BaseCodeTokenModel):
|
||||
|
||||
user = models.ForeignKey(
|
||||
settings.AUTH_USER_MODEL, verbose_name=_(u'User'), on_delete=models.CASCADE)
|
||||
code = models.CharField(max_length=255, unique=True, verbose_name=_(u'Code'))
|
||||
nonce = models.CharField(max_length=255, blank=True, default='', verbose_name=_(u'Nonce'))
|
||||
is_authentication = models.BooleanField(default=False, verbose_name=_(u'Is Authentication?'))
|
||||
|
@ -206,6 +206,8 @@ class Token(BaseCodeTokenModel):
|
|||
|
||||
class UserConsent(BaseCodeTokenModel):
|
||||
|
||||
user = models.ForeignKey(
|
||||
settings.AUTH_USER_MODEL, verbose_name=_(u'User'), on_delete=models.CASCADE)
|
||||
date_given = models.DateTimeField(verbose_name=_(u'Date Given'))
|
||||
|
||||
class Meta:
|
||||
|
|
Loading…
Reference in a new issue