def Seminarcancele(SeminarId): seminar = Seminar.query.filter_by(seminar_id=int(SeminarId)).one() Eventsystem.remove_all_user(seminar) Eventsystem.cancele_all_session(seminar) seminar.status = 'CANCELED' Eventsystem.add_seminar(seminar) return redirect(url_for('index'))
def postSeminar(): if request.method == 'POST': title = request.form['title'] start = request.form['start'] end = request.form['end'] capacity = request.form['capacity'] detail = request.form['detail'] status = 'OPEN' try: Eventsystem.check_start(start) Eventsystem.check_data(start, end) Eventsystem.valida_seminar_capa(capacity) seminar = Eventsystem.make_seminar(title, detail, start, end, capacity, status, current_user.name) Eventsystem.add_seminar(seminar) return redirect(url_for('index')) except ErrorMessage as error: return render_template('postseminar.html', val_post=True, post_info=error.msg) return render_template('postseminar.html')