This commit is contained in:
Aevann1 2021-12-13 23:27:25 +02:00
parent adb855fd44
commit 68b4c603ab
8 changed files with 17 additions and 25 deletions

View file

@ -53,6 +53,7 @@ def publish(pid, v):
post = get_post(pid)
if not post.author_id == v.id: abort(403)
post.private = False
post.created_utc = int(time.time())
g.db.add(post)
notify_users = NOTIFY_USERS(f'{post.body_html}{post.title}', v.id)
@ -97,7 +98,7 @@ def post_id(pid, anything=None, v=None):
try: pid = int(pid)
except Exception as e: pass
if request.host == 'rdrama.net' and pid in [BUG_THREAD, EMOJI_THREAD]: defaultsortingcomments = 'new'
if 'rdrama.net' in request.host and pid in [BUG_THREAD, EMOJI_THREAD]: defaultsortingcomments = 'new'
elif v: defaultsortingcomments = v.defaultsortingcomments
else: defaultsortingcomments = "top"
@ -958,7 +959,8 @@ def submit_post(v):
body_html=body_html,
embed_url=embed,
title=title[:500],
title_html=title_html
title_html=title_html,
created_utc=int(time.time())
)
g.db.add(new_post)