Exemple #1
0
    def get(self, tip_token, *uriargs):
        """
        Parameters: None (TODO start/end, date)
        Response: actorsCommentList
        Errors: InvalidTipAuthToken
        """

        try:

            if is_receiver_token(tip_token):
                requested_t = ReceiverTip()
                tip_description = yield requested_t.get_single(tip_token)
            else:
                requested_t = WhistleblowerTip()
                tip_description = yield requested_t.get_single(tip_token)

            comment_iface = Comment()
            comment_list = yield comment_iface.get_comment_by_itip(tip_description['internaltip_id'])

            self.set_status(200)
            self.write(json.dumps(comment_list))

        except TipGusNotFound, e:

            self.set_status(e.http_status)
            self.write({'error_message' : e.error_message, 'error_code' : e.error_code})
Exemple #2
0
    def get_comment_list_by_wb(self, receipt):

        store = self.getStore()

        requested_t = WhistleblowerTip(store)
        tip_description = requested_t.get_single(receipt)

        comment_iface = Comment(store)
        comment_list = comment_iface.get_comment_by_itip(tip_description['internaltip_id'])

        self.returnData(comment_list)
        self.returnCode(200)
        return self.prepareRetVals()