Merge branch 'dev' into feature-bulk-edit

This commit is contained in:
jonaswinkler
2020-12-25 22:19:10 +01:00
37 changed files with 243 additions and 246 deletions

View File

@@ -95,19 +95,21 @@ class Consumer(LoggingMixin):
self.pre_check_directories()
self.pre_check_duplicate()
self.log("info", "Consuming {}".format(self.filename))
self.log("info", f"Consuming {self.filename}")
# Determine the parser class.
mime_type = magic.from_file(self.path, mime=True)
self.log("debug", f"Detected mime type: {mime_type}")
parser_class = get_parser_class_for_mime_type(mime_type)
if not parser_class:
raise ConsumerError(f"No parsers abvailable for {self.filename}")
raise ConsumerError(
f"Unsupported mime type {mime_type} of file {self.filename}")
else:
self.log("debug",
f"Parser: {parser_class.__name__} "
f"based on mime type {mime_type}")
f"Parser: {parser_class.__name__}")
# Notify all listeners that we're going to do some work.

View File

@@ -98,12 +98,14 @@ class DocumentFilterSet(FilterSet):
"added": DATE_KWARGS,
"modified": DATE_KWARGS,
"correspondent": ["isnull"],
"correspondent__id": ID_KWARGS,
"correspondent__name": CHAR_KWARGS,
"tags__id": ID_KWARGS,
"tags__name": CHAR_KWARGS,
"document_type": ["isnull"],
"document_type__id": ID_KWARGS,
"document_type__name": CHAR_KWARGS,