import json
import logging
import zeit.brightcove.update2


log = logging.getLogger(__name__)


class Notification(object):

    def __call__(self):
        body = self.request.bodyStream.read(
            int(self.request['CONTENT_LENGTH']))
        data = json.loads(body)
        if data.get('event') != 'video-change' or not data.get('video'):
            return
        zeit.brightcove.update2.import_video_async(data.get('video'))

@@ -116,16 +116,291 @@
 object):
+%0A    %22%22%22This view is a receiver for notification events. We register it as a%0A    %22subscription%22 in the Brightcove API, and _they_ will call it each time a%0A    video is added/changed/deleted.%0A%0A    See %3Chttps://support.brightcove.com/cms-api-notifications%3E for details.%0A    %22%22%22
 %0A%0A    de

Document view class