mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
always use datetime.date.isoformat to generate filename
fixes #267 Signed-off-by: Oliver Lippert <info@trusty.codes>
This commit is contained in:
parent
0ba1ba55bd
commit
182cea3385
@ -11,7 +11,6 @@ from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
from django.db import models
|
||||
from django.utils import timezone
|
||||
from django.utils.timezone import is_aware
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from documents.parsers import get_default_file_extension
|
||||
|
||||
@ -210,10 +209,8 @@ class Document(models.Model):
|
||||
verbose_name_plural = _("documents")
|
||||
|
||||
def __str__(self):
|
||||
if is_aware(self.created):
|
||||
created = timezone.localdate(self.created).isoformat()
|
||||
else:
|
||||
created = datetime.date.isoformat(self.created)
|
||||
created = datetime.date.isoformat(self.created)
|
||||
|
||||
if self.correspondent and self.title:
|
||||
return f"{created} {self.correspondent} {self.title}"
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user