def push(): tracker = TrackerAPI(config.TRELLO_KEY, config.TRELLO_TOKEN) data = json.loads(request.data) state_router = { 'success': 'green', 'pending': 'yellow', 'failure': 'red', 'error' : 'red', } state_details = { 'card': data['pull_request']['body'], 'state': state_router[data['state']] } tracker.change_state(**state_details) return render_template('response.html', response='done')
def push(): tracker = TrackerAPI(config.TRELLO_KEY, config.TRELLO_TOKEN) data = json.loads(request.data) state_router = { 'success': 'green', 'pending': 'yellow', 'failure': 'red', 'error': 'red', } state_details = { 'card': data['pull_request']['body'], 'state': state_router[data['state']] } tracker.change_state(**state_details) return render_template('response.html', response='done')
def change_label(): tracker = TrackerAPI(config.TRELLO_KEY, config.TRELLO_TOKEN) response = tracker.change_state(request.form['card'], request.form['state']) return render_template('response.html', response=response)