def recieve_data(): data = request.json insert_raw_deployment(db.Session(), data['author'], data['name'], data['tags'].split(','), datetime.now()) return 'True'
def add_dummy(): """ Add a dummy module download every time this is hit """ insert_raw_deployment(db.Session(), 'nibz', 'puppetboard', ['awesome', 'ci', 'production'], datetime.datetime.utcnow()) return 'True'
def recieve_data(): data = request.json try: author = data['author'] module = data['name'] except (KeyError, TypeError): abort(400) try: tags = data['tags'] except KeyError: tags = [] else: tags = tags.split(',') insert_raw_deployment(db.Session(), author, module, tags, datetime.datetime.utcnow()) return 'True'