oauth2: use auto_now_add for creation_date fields (#22682)
This commit is contained in:
parent
a0a4c7962f
commit
23124dbe34
|
@ -0,0 +1,25 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.11 on 2018-03-26 13:30
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('oauth2', '0003_auto_20180322_1016'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='oauth2authorize',
|
||||
name='creation_date',
|
||||
field=models.DateTimeField(auto_now_add=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='oauth2tempfile',
|
||||
name='creation_date',
|
||||
field=models.DateTimeField(auto_now_add=True),
|
||||
),
|
||||
]
|
|
@ -68,7 +68,7 @@ class OAuth2Authorize(models.Model):
|
|||
user_document = models.ForeignKey(UserDocument)
|
||||
access_token = models.CharField(max_length=255, default=generate_uuid)
|
||||
code = models.CharField(max_length=255, default=generate_uuid)
|
||||
creation_date = models.DateTimeField(auto_now=True)
|
||||
creation_date = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
def __repr__(self):
|
||||
return 'OAuth2Authorize for document %r' % self.user_document
|
||||
|
@ -79,4 +79,4 @@ class OAuth2TempFile(models.Model):
|
|||
client = models.ForeignKey(OAuth2Client)
|
||||
document = models.ForeignKey(Document)
|
||||
filename = models.CharField(max_length=512)
|
||||
creation_date = models.DateTimeField(auto_now=True)
|
||||
creation_date = models.DateTimeField(auto_now_add=True)
|
||||
|
|
Loading…
Reference in New Issue