Esempio n. 1
0
    def post(self, conversation_id):
        conversation = ndb.Key(Conversation, int(conversation_id)).get()

        if not conversation or self.user.key not in conversation.visibleto_user_keys:
            return self.abort(404)

        message = Message(conversation_key=conversation.key, sender_key=self.user.key, body=self.request.body)
        message.put()

        message.process()
        self.render_json_response(message)