diff --git a/app/panel/routes.py b/app/panel/routes.py index 39fc743..2ec384c 100644 --- a/app/panel/routes.py +++ b/app/panel/routes.py @@ -100,7 +100,7 @@ def dashboard(user_pid): return render_template('panel/dashboard.html', sys_regions=sys_regions, inv_deployments=inv_deployments, inv_services=inv_services, inv_domains=inv_domains, inv_addresses=inv_addresses, rrd=rrd, status=statuses, warnflag=warnflag, regions=regions) #SUPPORT -@panel.route("/support", methods=['GET', 'POST']) +@panel.route("/support", methods=['GET']) @login_required def list_support(): """ general enquiry and list all open support tasks """ @@ -142,7 +142,7 @@ def support(topic): expiry = time_last_topic + relativedelta(time_last_topic, minutes=+5) if now < expiry: flash('ratelimit. try again later') - return None + return redirect(url_for('panel.dashboard')) #create new topic new_topic = SupportTopic(user_id=cuser.pid, hashtag=str(topic)) db.session.add(new_topic) @@ -150,11 +150,12 @@ def support(topic): db.session.add(new_line) else: - if support_topic.user_id == cuser.user_id: - new_line = SupportLine(topic_id=int(support_topic.pid), line=str(form.line.data)) + if support_topic.user_id == cuser.pid: + new_line = SupportLine(topic_id=support_topic.pid, line=form.line.data) db.session.add(new_line) else: abort(403) #TODO: hidden 404 db.session.commit() - return None + return redirect(url_for('panel.dashboard')) + diff --git a/app/templates/panel/support_list.html b/app/templates/panel/support_list.html index af2b9e8..e60fb0a 100644 --- a/app/templates/panel/support_list.html +++ b/app/templates/panel/support_list.html @@ -24,7 +24,7 @@ $('a[data-toggle="tooltip"]').tooltip({
Support

- {% for topic in inv_topics %} + {% for support in inv_topics %} {% include "panel/support_item.html" %} {% endfor %}