Example #1
0
    def post(self, fb_id, book_type):
        """
        An empty POST to this endpoint
        spins off the `run_book` task
        """
        if not self.is_authorized(fb_id):
            abort(403)

        book = ALL_BOOKS.get(book_type)
        if book is None:
            abort(404)

        # Run the book's task
        print 'POST recieved for book %s' % book.title

        pass
Example #2
0
 def get_depends_on_task_name(self, url, book_type):
     # Look up the book and return the proper task
     book = ALL_BOOKS.get(book_type)
     return book.run_task_name