mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 00:05:21 +01:00
Support bulk edit owner
This commit is contained in:
parent
a5ab6f2558
commit
6dc5c1de32
10 changed files with 47 additions and 37 deletions
|
|
@ -12,6 +12,7 @@ from asgiref.sync import async_to_sync
|
|||
from celery import shared_task
|
||||
from channels.layers import get_channel_layer
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
from django.db import transaction
|
||||
from django.db.models.signals import post_save
|
||||
from documents import barcodes
|
||||
|
|
@ -284,3 +285,12 @@ def update_document_archive_file(document_id):
|
|||
)
|
||||
finally:
|
||||
parser.cleanup()
|
||||
|
||||
|
||||
@shared_task
|
||||
def update_owner_for_object(document_ids, owner):
|
||||
documents = Document.objects.filter(id__in=document_ids)
|
||||
ownerUser = User.objects.get(pk=owner)
|
||||
for document in documents:
|
||||
document.owner = ownerUser
|
||||
document.save()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue