(self, request, tenant_id, np_id)
return b''
Alter a notification plan
Alter a notification plan
Alter a notification plan
def update_notification_plan(self, request, tenant_id, np_id):
        """
        Alter a notification plan
        """
        content = request.content.read()
        postdata = json.loads(content.decode("utf-8"))
        update_kwargs = dict(postdata)
        notification_plans = self._entity_cache_for_tenant(
            tenant_id).notification_plans

        try:
            notification_plan = _get_notification_plan(
                notification_plans, np_id)
            notification_plan.update(
                clock=self._session_store.clock, **update_kwargs)
        except ObjectDoesNotExist as e:
            request.setResponseCode(e.code)
            self._audit('notification_plans', 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('notification_plans', request, tenant_id, status, content)
        return b''
def update_notification_plan ( self , request , tenant_id , np_id ) : content = request . content . read ( ) postdata = json . loads ( content . decode ( "utf-8" ) ) update_kwargs = dict ( postdata ) notification_plans = self . _entity_cache_for_tenant ( tenant_id ) . notification_plans try : notification_plan = _get_notification_plan ( notification_plans , np_id ) notification_plan . update ( clock = self . _session_store . clock , * * update_kwargs ) except ObjectDoesNotExist as e : request . setResponseCode ( e . code ) self . _audit ( 'notification_plans' , 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 ( 'notification_plans' , request , tenant_id , status , content ) return b''