mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-18 12:37:08 +01:00
made the file renamer somewhat faster.
This commit is contained in:
parent
a0631413d6
commit
f5cc5fbaa3
1 changed files with 2 additions and 2 deletions
|
|
@ -2,6 +2,7 @@ import logging
|
||||||
|
|
||||||
import tqdm
|
import tqdm
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
|
from django.db.models.signals import post_save
|
||||||
|
|
||||||
from documents.models import Document
|
from documents.models import Document
|
||||||
from ...mixins import Renderable
|
from ...mixins import Renderable
|
||||||
|
|
@ -24,5 +25,4 @@ class Command(Renderable, BaseCommand):
|
||||||
logging.getLogger().handlers[0].level = logging.ERROR
|
logging.getLogger().handlers[0].level = logging.ERROR
|
||||||
|
|
||||||
for document in tqdm.tqdm(Document.objects.all()):
|
for document in tqdm.tqdm(Document.objects.all()):
|
||||||
# Saving the document again will generate a new filename and rename
|
post_save.send(Document, instance=document)
|
||||||
document.save()
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue