mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-11 00:57:09 +01:00
Fix for #107
This commit is contained in:
parent
90939be6af
commit
e96c7448bc
1 changed files with 12 additions and 10 deletions
|
|
@ -292,11 +292,13 @@ class Consumer(object):
|
||||||
|
|
||||||
self.log("debug", "Saving record to database")
|
self.log("debug", "Saving record to database")
|
||||||
|
|
||||||
|
with open(doc, "rb") as f:
|
||||||
document = Document.objects.create(
|
document = Document.objects.create(
|
||||||
correspondent=file_info.correspondent,
|
correspondent=file_info.correspondent,
|
||||||
title=file_info.title,
|
title=file_info.title,
|
||||||
content=text,
|
content=text,
|
||||||
file_type=file_info.extension,
|
file_type=file_info.extension,
|
||||||
|
checksum=hashlib.md5(f.read()).hexdigest(),
|
||||||
created=timezone.make_aware(
|
created=timezone.make_aware(
|
||||||
datetime.datetime.fromtimestamp(stats.st_mtime)),
|
datetime.datetime.fromtimestamp(stats.st_mtime)),
|
||||||
modified=timezone.make_aware(
|
modified=timezone.make_aware(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue