Add keyword arguments

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2019-05-12 02:09:26 -04:00
parent 0d53e74238
commit c7e9a4dc99
28 changed files with 84 additions and 74 deletions

View File

@@ -1,6 +1,5 @@
from __future__ import absolute_import, unicode_literals
import hashlib
import logging
import uuid
@@ -8,7 +7,7 @@ from django.apps import apps
from django.core.files import File
from django.db import models
from django.urls import reverse
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.encoding import python_2_unicode_compatible
from django.utils.timezone import now
from django.utils.translation import ugettext, ugettext_lazy as _
@@ -22,19 +21,10 @@ from ..signals import post_document_type_change
from .document_type_models import DocumentType
__all__ = ('Document', 'UUID_FUNCTION')
__all__ = ('Document',)
logger = logging.getLogger(__name__)
# document image cache name hash function
def hash_function():
return hashlib.sha256()
def UUID_FUNCTION(*args, **kwargs):
return force_text(uuid.uuid4())
@python_2_unicode_compatible
class Document(models.Model):
"""
@@ -137,7 +127,9 @@ class Document(models.Model):
return False
def get_absolute_url(self):
return reverse('documents:document_preview', args=(self.pk,))
return reverse(
viewname='documents:document_preview', kwargs={'pk': self.pk}
)
def get_api_image_url(self, *args, **kwargs):
latest_version = self.latest_version