mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 16:25:33 +01:00
Moves the renaming ttask into the serialiser update instead of post_save. Feels more correct
This commit is contained in:
parent
5e3ef94697
commit
abc58000b4
4 changed files with 46 additions and 104 deletions
|
|
@ -801,6 +801,17 @@ class StoragePathSerializer(MatchingModelSerializer, OwnedObjectSerializer):
|
|||
|
||||
return path
|
||||
|
||||
def update(self, instance, validated_data):
|
||||
"""
|
||||
When a storage path is updated, see if documents
|
||||
using it require a rename/move
|
||||
"""
|
||||
doc_ids = [doc.id for doc in instance.documents.all()]
|
||||
if len(doc_ids):
|
||||
bulk_edit.bulk_update_documents.delay(doc_ids)
|
||||
|
||||
return super().update(instance, validated_data)
|
||||
|
||||
|
||||
class UiSettingsViewSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue