fix bugs
This commit is contained in:
parent
a8c472dfe8
commit
cd8fa2a86c
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue