Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

The exporter now re-dates the files

Daniel Quinnd69df37fb616
diff --git a/src/documents/management/commands/document_exporter.py b/src/documents/management/commands/document_exporter.py
index 8b350a39f..6e858e7ec 100644
--- a/src/documents/management/commands/document_exporter.py
+++ b/src/documents/management/commands/document_exporter.py
@@ -1,5 +1,6 @@
import gnupg
import os
+import time
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
@@ -47,6 +48,10 @@ class Command(BaseCommand):
with open(target, "wb") as f:
f.write(GnuPG.decrypted(document.pdf))
+ os.utime(target, times=(
+ int(time.mktime(document.created.timetuple())),
+ int(time.mktime(document.modified.timetuple()))
+ ))
def _render(self, text, verbosity):
if self.verbosity >= verbosity: