remotes/1693045480750635534/spooky-22
Aevann1 2021-10-14 14:40:44 +02:00
parent d6a6faeb61
commit 14b2c8e9fc
2 changed files with 3 additions and 2 deletions

View File

@ -379,7 +379,7 @@ def api_comment(v):
c.upvotes += 1
g.db.add(c)
if "rama" in request.host and len(body) >= 1000 and v.username != "Snappy" and "</blockquote>" not in body_html:
if "rama" in request.host and len(c.body) >= 1000 and v.username != "Snappy" and "</blockquote>" not in body_html:
body = random.choice(LONGPOST_REPLIES)
body = re.sub('([^\n])\n([^\n])', r'\1\n\n\2', body)

View File

@ -192,7 +192,8 @@ def songs(id):
try: id = int(id)
except: return "", 400
user = g.db.query(User).options(lazyload('*')).filter_by(id=id).first()
return redirect(f"/song/{user.song}.mp3")
if user and user.song: return redirect(f"/song/{user.song}.mp3")
else: abort(404)
@app.get("/song/<song>")
def song(song):