mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-19 13:06:46 +01:00
Fixes #45
This commit is contained in:
parent
eb01bcf98b
commit
1e7ece81ee
3 changed files with 18 additions and 9 deletions
|
|
@ -23,9 +23,10 @@ class Command(Renderable, BaseCommand):
|
|||
self.verbosity = options["verbosity"]
|
||||
|
||||
for document in Document.objects.all():
|
||||
|
||||
tags = Tag.objects.exclude(
|
||||
pk__in=document.tags.values_list("pk", flat=True))
|
||||
for tag in tags:
|
||||
if tag.matches(document.content):
|
||||
print('Tagging {} with "{}"'.format(document, tag))
|
||||
document.tags.add(tag)
|
||||
|
||||
for tag in Tag.match_all(document.content, tags):
|
||||
print('Tagging {} with "{}"'.format(document, tag))
|
||||
document.tags.add(tag)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue