def save_data(self, trigger_id, **data):
        """
            let's save the data
            :param trigger_id: trigger ID from which to save data
            :param data: the data to check to be used and save
            :type trigger_id: int
            :type data:  dict
            :return: the status of the save statement
            :rtype: boolean
        """
        if self.token:
            title = self.set_title(data)
            body = self.set_content(data)
            # get the details of this trigger
            trigger = Github.objects.get(trigger_id=trigger_id)

            # check if it remains more than 1 access
            # then we can create an issue
            limit = self.gh.ratelimit_remaining
            if limit > 1:
                # repo goes to "owner"
                # project goes to "repository"
                r = self.gh.create_issue(trigger.repo, trigger.project, title, body)
            else:
                # rate limit reach
                logger.warning("Rate limit reached")
                update_result(trigger_id, msg="Rate limit reached", status=True)
                # put again in cache the data that could not be
                # published in Github yet
                cache.set('th_github_' + str(trigger_id), data, version=2)
                return True
            sentence = str('github {} created').format(r)
            logger.debug(sentence)
            status = True
        else:
            sentence = "no token or link provided for trigger ID {} ".format(trigger_id)
            logger.critical(sentence)
            update_result(trigger_id, msg=sentence, status=False)
            status = False

        return status
def save_data ( self , trigger_id , ** data ) : if self . token : title = self . set_title ( data ) body = self . set_content ( data ) trigger = Github . objects . get ( trigger_id = trigger_id ) limit = self . gh . ratelimit_remaining if limit > 1 : r = self . gh . create_issue ( trigger . repo , trigger . project , title , body ) else : logger . warning ( "Rate limit reached" ) update_result ( trigger_id , msg = "Rate limit reached" , status = True ) cache . set ( 'th_github_' + str ( trigger_id ) , data , version = 2 ) return True sentence = str ( 'github {} created' ) . format ( r ) logger . debug ( sentence ) status = True else : sentence = "no token or link provided for trigger ID {} " . format ( trigger_id ) logger . critical ( sentence ) update_result ( trigger_id , msg = sentence , status = False ) status = False return status
let's save the data
            :param trigger_id: trigger ID from which to save data
            :param data: the data to check to be used and save
            :type trigger_id: int
            :type data:  dict
            :return: the status of the save statement
            :rtype: boolean