Esempio n. 1
0
 def patch(self):
     asset = self.context
     apply_patch(self.request, src=self.request.validated['asset_src'])
     self.LOGGER.info('Updated asset {}'.format(asset.id),
                      extra=context_unpack(self.request,
                                           {'MESSAGE_ID': 'asset_patch'}))
     return {'data': asset.serialize(asset.status)}
Esempio n. 2
0
 def patch(self):
     self.request.registry.getAdapter(
         self.context, IAssetManager).change_asset(self.request)
     asset = self.context
     if asset.status == 'active' and self.request.validated['data'].get(
             'status') == 'pending':
         self.request.validated['data']['relatedLot'] = None
         self.request.validated['asset'].relatedLot = None
     apply_patch(self.request, src=self.request.validated['asset_src'])
     self.LOGGER.info('Updated asset {}'.format(asset.id),
                      extra=context_unpack(self.request,
                                           {'MESSAGE_ID': 'asset_patch'}))
     return {'data': asset.serialize(asset.status)}
Esempio n. 3
0
 def patch(self):
     """Asset Item Update"""
     if apply_patch(self.request, src=self.request.context.serialize()):
         update_file_content_type(self.request)
         self.LOGGER.info('Updated asset item {}'.format(self.request.context.id),
                     extra=context_unpack(self.request, {'MESSAGE_ID': 'asset_item_patch'}))
         return {'data': self.request.context.serialize("view")}
Esempio n. 4
0
 def patch(self):
     """Asset Decision Update"""
     if apply_patch(self.request, src=self.request.context.serialize()):
         self.LOGGER.info(
             'Updated asset decision {}'.format(self.request.context.id),
             extra=context_unpack(self.request,
                                  {'MESSAGE_ID': 'asset_decision_patch'}))
         return {'data': self.request.context.serialize("view")}
Esempio n. 5
0
 def update(self, request):
     return apply_patch(request, src=request.context.serialize())