more bugfix
This commit is contained in:
parent
cd8fa2a86c
commit
75dacd8c8a
2 changed files with 7 additions and 6 deletions
|
@ -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)
|
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
|
#SUPPORT
|
||||||
@panel.route("/support", methods=['GET', 'POST'])
|
@panel.route("/support", methods=['GET'])
|
||||||
@login_required
|
@login_required
|
||||||
def list_support():
|
def list_support():
|
||||||
""" general enquiry and list all open support tasks """
|
""" 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)
|
expiry = time_last_topic + relativedelta(time_last_topic, minutes=+5)
|
||||||
if now < expiry:
|
if now < expiry:
|
||||||
flash('ratelimit. try again later')
|
flash('ratelimit. try again later')
|
||||||
return None
|
return redirect(url_for('panel.dashboard'))
|
||||||
#create new topic
|
#create new topic
|
||||||
new_topic = SupportTopic(user_id=cuser.pid, hashtag=str(topic))
|
new_topic = SupportTopic(user_id=cuser.pid, hashtag=str(topic))
|
||||||
db.session.add(new_topic)
|
db.session.add(new_topic)
|
||||||
|
@ -150,11 +150,12 @@ def support(topic):
|
||||||
db.session.add(new_line)
|
db.session.add(new_line)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if support_topic.user_id == cuser.user_id:
|
if support_topic.user_id == cuser.pid:
|
||||||
new_line = SupportLine(topic_id=int(support_topic.pid), line=str(form.line.data))
|
new_line = SupportLine(topic_id=support_topic.pid, line=form.line.data)
|
||||||
db.session.add(new_line)
|
db.session.add(new_line)
|
||||||
else:
|
else:
|
||||||
abort(403) #TODO: hidden 404
|
abort(403) #TODO: hidden 404
|
||||||
|
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
return None
|
return redirect(url_for('panel.dashboard'))
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ $('a[data-toggle="tooltip"]').tooltip({
|
||||||
<div class="panel-heading">Support</div>
|
<div class="panel-heading">Support</div>
|
||||||
<div class="panel-body"><p>
|
<div class="panel-body"><p>
|
||||||
<div class="panel-group" id="<s" role="tablist" aria-multiselectable="true">
|
<div class="panel-group" id="<s" role="tablist" aria-multiselectable="true">
|
||||||
{% for topic in inv_topics %}
|
{% for support in inv_topics %}
|
||||||
{% include "panel/support_item.html" %}
|
{% include "panel/support_item.html" %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue