(self, request, tenant_id, nt_id)
return b''
Updates notification targets
Updates notification targets
Updates notification targets
def update_notifications(self, request, tenant_id, nt_id):
        """
        Updates notification targets
        """
        content = request.content.read()
        postdata = json.loads(content.decode("utf-8"))
        update_kwargs = dict(postdata)
        notifications = self._entity_cache_for_tenant(tenant_id).notifications

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