Skip to content

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

Fixed conflicts

Daniel Quinnb11825832d37
diff --cc src/documents/management/commands/document_consumer.py
index a03845bd3,5f135fd22..b035eb22a
--- a/src/documents/management/commands/document_consumer.py
+++ b/src/documents/management/commands/document_consumer.py
@@@ -15,7 -21,7 +21,8 @@@ class Command(BaseCommand)
On every iteration of an infinite loop, consume what we can from the
consumption directory, and fetch any mail available.
"""
+
+ CONSUME_USER_ID = 1
LOOP_TIME = 10 # Seconds
MAIL_DELTA = datetime.timedelta(minutes=10)
@@@ -67,3 -73,17 +74,17 @@@
delta = self.mail_fetcher.last_checked + self.MAIL_DELTA
if delta < datetime.datetime.now():
self.mail_fetcher.pull()
+
+ @receiver(document_consumption_finished)
+ def notify_finished(sender, document=None, logging_group=None, **kwargs):
+ doctype = ContentType.objects.get_for_model(Document)
- user = User.objects.get(**{'id': Command.CONSUME_USER_ID})
++ user = User.objects.get(pk=Command.CONSUME_USER_ID)
+
+ LogEntry.objects.log_action(
+ user_id=user.pk,
+ content_type_id=doctype.pk,
+ object_id=document.pk,
+ object_repr=repr(document),
+ action_flag=ADDITION,
+ change_message='Document %s consumption finished' % document.title
+ )