Update usage of datetime.now to Django timezone aware now()
This commit is contained in:
@@ -6,6 +6,7 @@ import logging
|
||||
from django.contrib.contenttypes import generic
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.db import models
|
||||
from django.utils.timezone import now
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from documents.models import Document
|
||||
@@ -41,7 +42,7 @@ class DocumentCheckout(models.Model):
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
if not self.pk:
|
||||
self.checkout_datetime = datetime.datetime.now()
|
||||
self.checkout_datetime = now()
|
||||
result = super(DocumentCheckout, self).save(*args, **kwargs)
|
||||
create_history(HISTORY_DOCUMENT_CHECKED_OUT, source_object=self.document, data={'user': self.user_object, 'document': self.document})
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user