def award_degree(): # To be able to reload if request.method == 'GET': return render_template('index.html', js_folder=url_for('static', filename='js'), img_folder=url_for('static', filename='img'), css_folder=url_for('static', filename='css'), school=1) try: school = School(session['school_seed']) name = request.form['name'].lower() response = school.award_degree(request.form['address'], name, request.form['birthdate'], request.form['year']) return render_template('index.html', js_folder=url_for('static', filename='js'), img_folder=url_for('static', filename='img'), css_folder=url_for('static', filename='css'), school=1, txhash=response['hash']) except Exception as e: return render_template('index.html', js_folder=url_for('static', filename='js'), img_folder=url_for('static', filename='img'), css_folder=url_for('static', filename='css'), school=1, awarderror=e)