def post(self):
        complaint = self.request.context
        tender = self.request.validated['tender']
        qualification_id = self.request.validated['qualification_id']
        location = self.request.route_path(
            'Tender EU Qualification Complaints',
            tender_id=tender.id,
            qualification_id=qualification_id,
            complaint_id=complaint.id)
        location = location[len(ROUTE_PREFIX):]  # strips /api/<version>

        if change_ownership(self.request, location) and save_tender(
                self.request):
            self.LOGGER.info(
                'Updated qualification {} complaint {} ownership of tender {}'.
                format(complaint.id, qualification_id, tender.id),
                extra=context_unpack(
                    self.request,
                    {'MESSAGE_ID': 'qualification_complaint_ownership_update'},
                    {
                        'complaint_id': complaint.id,
                        'qualification_id': qualification_id,
                        'tender_id': tender.id
                    }))

            return {'data': complaint.serialize('view')}
Exemple #2
0
    def post(self):
        tender = self.request.validated['tender']
        location = self.request.route_path('Tender', tender_id=tender.id)
        location = location[len(ROUTE_PREFIX):]  # strips /api/<version>

        if change_ownership(self.request, location) and save_tender(self.request):
            self.LOGGER.info('Updated ownership of tender {}'.format(tender.id),
                             extra=context_unpack(self.request, {'MESSAGE_ID': 'tender_ownership_update'}))

            return {'data': tender.serialize('view')}
    def post(self):
        complaint = self.request.context
        tender = self.request.validated['tender']
        award_id = self.request.validated['award_id']
        location = self.request.route_path('{}:Tender Award Complaints'.format(
            tender['procurementMethodType']), tender_id=tender.id, award_id=award_id, complaint_id=complaint.id)
        location = location[len(ROUTE_PREFIX):]  # strips /api/<version>

        if change_ownership(self.request, location) and save_tender(self.request):
            self.LOGGER.info('Updated award {} complaint {} ownership of tender {}'.format(complaint.id, award_id, tender.id),
                             extra=context_unpack(self.request, {'MESSAGE_ID': 'award_complaint_ownership_update'}, {'complaint_id': complaint.id, 'award_id': award_id, 'tender_id': tender.id}))

            return {'data': complaint.serialize('view')}
Exemple #4
0
    def post(self):
        bid = self.request.context
        tender = self.request.validated['tender']
        location = self.request.route_path('{}:Tender Bids'.format(
            tender['procurementMethodType']),
                                           tender_id=tender.id,
                                           bid_id=bid.id)
        location = location[len(ROUTE_PREFIX):]  # strips /api/<version>

        if change_ownership(self.request, location) and save_tender(
                self.request):
            self.LOGGER.info(
                'Updated bid {} ownership of tender {}'.format(
                    bid.id, tender.id),
                extra=context_unpack(self.request,
                                     {'MESSAGE_ID': 'bid_ownership_update'}, {
                                         'bid_id': bid.id,
                                         'tender_id': tender.id
                                     }))

            return {'data': bid.serialize('view')}
Exemple #5
0
    def post(self):
        contract = self.request.validated['contract']

        if contract.status != "active":
            self.request.errors.add(
                'body', 'data',
                'Can\'t update credentials in current ({}) contract status'.
                format(contract.status))
            self.request.errors.status = 403
            return

        location = self.request.route_path('Contract', contract_id=contract.id)
        location = location[len(ROUTE_PREFIX):]  # strips /api/<version>
        if change_ownership(self.request, location) and save_contract(
                self.request):
            self.LOGGER.info(
                'Updated ownership of contract {}'.format(contract.id),
                extra=context_unpack(
                    self.request, {'MESSAGE_ID': 'contract_ownership_update'}))

            return {'data': contract.serialize('view')}