fgd
This commit is contained in:
parent
aab66fbe2e
commit
80a6c1b033
2 changed files with 6 additions and 3 deletions
|
@ -133,7 +133,9 @@ def notifications(v):
|
|||
@limiter.limit("3/second;30/minute;400/hour;2000/day")
|
||||
@auth_desired
|
||||
def front_all(v, sub=None):
|
||||
sub = g.db.query(Sub).filter_by(name=sub).one_or_none()
|
||||
if sub: sub = g.db.query(Sub).filter_by(name=sub).one_or_none()
|
||||
|
||||
if request.path.startswith('/s/') and not sub: abort(404)
|
||||
|
||||
if g.webview and not session.get("session_id"):
|
||||
session.permanent = True
|
||||
|
|
|
@ -91,9 +91,10 @@ def publish(pid, v):
|
|||
@app.get("/s/<sub>/submit")
|
||||
@auth_required
|
||||
def submit_get(v, sub=None):
|
||||
sub = g.db.query(Sub.name).filter_by(name=sub).one_or_none()
|
||||
if sub: sub = g.db.query(Sub.name).filter_by(name=sub).one_or_none()
|
||||
|
||||
if sub: sub = sub[0]
|
||||
else: sub = None
|
||||
elif request.path.startswith('/s/'): abort(404)
|
||||
|
||||
return render_template("submit.html", v=v, sub=sub)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue