mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Merge pull request #2777 from paperless-ngx/bugfix-owner-on-new-document
Don't submit owner via API on document upload
This commit is contained in:
commit
020abaf7d6
@ -28,7 +28,6 @@ export class UploadDocumentsService {
|
||||
fileEntry.file((file: File) => {
|
||||
let formData = new FormData()
|
||||
formData.append('document', file, file.name)
|
||||
formData.set('owner', this.settings.currentUser.id.toString())
|
||||
let status = this.consumerStatusService.newFileUpload(file.name)
|
||||
|
||||
status.message = $localize`Connecting...`
|
||||
|
@ -683,14 +683,6 @@ class PostDocumentSerializer(serializers.Serializer):
|
||||
required=False,
|
||||
)
|
||||
|
||||
owner = serializers.PrimaryKeyRelatedField(
|
||||
queryset=User.objects.all(),
|
||||
label="Owner",
|
||||
allow_null=True,
|
||||
write_only=True,
|
||||
required=False,
|
||||
)
|
||||
|
||||
archive_serial_number = serializers.IntegerField(
|
||||
label="ASN",
|
||||
write_only=True,
|
||||
@ -728,12 +720,6 @@ class PostDocumentSerializer(serializers.Serializer):
|
||||
else:
|
||||
return None
|
||||
|
||||
def validate_owner(self, owner):
|
||||
if owner:
|
||||
return owner.id
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
class BulkDownloadSerializer(DocumentListSerializer):
|
||||
|
||||
|
@ -672,7 +672,6 @@ class PostDocumentView(GenericAPIView):
|
||||
tag_ids = serializer.validated_data.get("tags")
|
||||
title = serializer.validated_data.get("title")
|
||||
created = serializer.validated_data.get("created")
|
||||
owner_id = serializer.validated_data.get("owner")
|
||||
archive_serial_number = serializer.validated_data.get("archive_serial_number")
|
||||
|
||||
t = int(mktime(datetime.now().timetuple()))
|
||||
@ -698,7 +697,7 @@ class PostDocumentView(GenericAPIView):
|
||||
override_tag_ids=tag_ids,
|
||||
task_id=task_id,
|
||||
override_created=created,
|
||||
override_owner_id=owner_id,
|
||||
override_owner_id=request.user.id,
|
||||
override_archive_serial_num=archive_serial_number,
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user