mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 08:15:27 +01:00
Refactor to get the document time once
This commit is contained in:
parent
da71eab0ae
commit
3f1392769d
2 changed files with 4 additions and 3 deletions
|
|
@ -69,15 +69,14 @@ class Command(Renderable, BaseCommand):
|
|||
|
||||
print("Exporting: {}".format(target))
|
||||
|
||||
t = int(time.mktime(document.created.timetuple()))
|
||||
with open(target, "wb") as f:
|
||||
f.write(GnuPG.decrypted(document.source_file))
|
||||
t = int(time.mktime(document.created.timetuple()))
|
||||
os.utime(target, times=(t, t))
|
||||
|
||||
with open(thumbnail_target, "wb") as f:
|
||||
f.write(GnuPG.decrypted(document.thumbnail_file))
|
||||
t = int(time.mktime(document.created.timetuple()))
|
||||
os.utime(target, times=(t, t))
|
||||
os.utime(thumbnail_target, times=(t, t))
|
||||
|
||||
manifest += json.loads(
|
||||
serializers.serialize("json", Correspondent.objects.all()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue