def get_repo(): """Download a specified repository""" msg, msg_type = install_repo(request.form['repo'], request.form['custom-repo']) # possible types: success, info, danger, warning flash(msg, msg_type) return redirect('/hub')
def get_repo(): """Download a specified repository""" try: install_repo(request.form['repo'], request.form['custom-repo']) msg = { 'title': "Success", 'body': "%s has been installed" % request.form['repo'], 'category': 'success', } except Exception as e: log.exception(e) msg = { 'title': "Error", 'body': str(e), 'category': 'danger', } flash(msg, '') return redirect('/hub')