def get(self, tip_token, *uriargs): """ Parameters: None Response: actorsTipDesc Errors: InvalidTipAuthToken tip_token can be: a tip_gus for a receiver, or a WhistleBlower receipt, understand the format, help in addressing which kind of Tip need to be handled. """ # file_iface = File() try: if is_receiver_token(tip_token): requested_t = ReceiverTip() tip_description = yield requested_t.receiver_get_single(tip_token) else: requested_t = WhistleblowerTip() tip_description = yield requested_t.whistleblower_get_single(tip_token) tip_description.pop('receiver_map') # need to be provided by input filtering self.set_status(200) self.write(json.dumps(tip_description)) except TipGusNotFound, e: self.set_status(e.http_status) self.write({'error_message' : e.error_message, 'error_code' : e.error_code})
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.receiver_get_single(tip_token) else: requested_t = WhistleblowerTip() tip_description = yield requested_t.whistleblower_get_single(tip_token) comment_iface = Comment() comment_list = yield comment_iface.get_comment_related(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})