(self, request, tenant_id, sp_id)
return b''
Update a suppression.
Update a suppression.
Update a suppression .
def update_suppression(self, request, tenant_id, sp_id):
        """
        Update a suppression.
        """
        content = request.content.read()
        postdata = json.loads(content.decode("utf-8"))
        update_kwargs = dict(postdata)
        suppressions = self._entity_cache_for_tenant(tenant_id).suppressions

        try:
            suppression = _get_suppression(suppressions, sp_id)
            suppression.update(
                clock=self._session_store.clock, **update_kwargs)
        except ObjectDoesNotExist as e:
            request.setResponseCode(e.code)
            self._audit('suppressions', request, tenant_id, e.code, content)
            return json.dumps(e.to_json())

        status = 204
        request.setResponseCode(status)
        request.setHeader(b'content-type', b'text/plain')
        self._audit('suppressions', request, tenant_id, status, content)
        return b''
def update_suppression ( self , request , tenant_id , sp_id ) : content = request . content . read ( ) postdata = json . loads ( content . decode ( "utf-8" ) ) update_kwargs = dict ( postdata ) suppressions = self . _entity_cache_for_tenant ( tenant_id ) . suppressions try : suppression = _get_suppression ( suppressions , sp_id ) suppression . update ( clock = self . _session_store . clock , * * update_kwargs ) except ObjectDoesNotExist as e : request . setResponseCode ( e . code ) self . _audit ( 'suppressions' , request , tenant_id , e . code , content ) return json . dumps ( e . to_json ( ) ) status = 204 request . setResponseCode ( status ) request . setHeader ( b'content-type' , b'text/plain' ) self . _audit ( 'suppressions' , request , tenant_id , status , content ) return b''