Example #1
0
    def publish(self, environ, params):
        try:
            req = Controller().getRequest()
            a = ActivityFactory.get(params['rid'])
            if not a:
                output.error('not found', 404)

            a.publish()
            for (blobType, values) in a.published['blobs'].items():
                for blobId in values:
                    BlobFactory.publish(blobId)

            ActivityFactory.update(a)
            output.success(a.toObject(), 200)
        except Error:
            pass

        return Controller().getResponse(True)