

@json_view(permission='upload_tender_documents', validators=(validate_file_update,))
def put(self):
    'Tender Document Update'
    if (((self.request.authenticated_role != 'auction') and (self.request.validated['tender_status'] != 'active.enquiries')) or ((self.request.authenticated_role == 'auction') and (self.request.validated['tender_status'] not in ['active.auction', 'active.qualification']))):
        self.request.errors.add('body', 'data', "Can't update document in current ({}) tender status".format(self.request.validated['tender_status']))
        self.request.errors.status = 403
        return
    document = upload_file(self.request)
    self.request.validated['tender'].documents.append(document)
    if save_tender(self.request):
        self.LOGGER.info('Updated tender document {}'.format(self.request.context.id), extra=context_unpack(self.request, {
            'MESSAGE_ID': 'tender_document_put',
        }))
        return {
            'data': document.serialize('view'),
        }

dataset/ETHPy150Open openprocurement/openprocurement.api/src/openprocurement/api/views/tender_document.py TenderDocumentResource.put/original