From cd8fa2a86c84183b71ebe349f4fcb713c1fa6771 Mon Sep 17 00:00:00 2001 From: deflax Date: Sun, 22 Apr 2018 03:33:12 +0300 Subject: [PATCH] fix bugs --- app/panel/routes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/panel/routes.py b/app/panel/routes.py index 8e2c2ed..39fc743 100644 --- a/app/panel/routes.py +++ b/app/panel/routes.py @@ -6,7 +6,7 @@ from . import panel from .forms import OrderForm, MessageForm from .. import db from ..email import send_email -from ..models import User, Permission, Recipe, Order, Server, Deployment, Service, Region, Address, Domain, SupportTopic, contact_proxmaster +from ..models import User, Permission, Recipe, Order, Server, Deployment, Service, Region, Address, Domain, SupportTopic, SupportLine, contact_proxmaster import base64 from datetime import date, time, datetime @@ -124,7 +124,7 @@ def support(topic): support_topic = EmptySupport() return render_template('panel/support_item.html', form=form, support=support_topic) else: - if support_topic.user_id != cuser.user_id: + if support_topic.user_id != cuser.pid: abort(403) #TODO: hidden 403. there is a topic like that but its not yours! else: #topic is yours. show it. @@ -144,9 +144,9 @@ def support(topic): flash('ratelimit. try again later') return None #create new topic - new_topic = SupportTopic(user_id=int(cuser.pid), hashtag=str(topic)) + new_topic = SupportTopic(user_id=cuser.pid, hashtag=str(topic)) db.session.add(new_topic) - new_line = SupportLine(topic_id=int(new_topic.pid), line=str(form.line.data)) + new_line = SupportLine(topic_id=new_topic.pid, line=str(form.line.data)) db.session.add(new_line) else: