remove more auth desireds on some routes
no need for the user at all here
This commit is contained in:
parent
ff09ba4209
commit
ce04999fb2
3 changed files with 9 additions and 18 deletions
|
@ -363,9 +363,7 @@ def changeloglist(v=None, sort="new", page=1, t="all", site=None):
|
||||||
|
|
||||||
|
|
||||||
@app.get("/random_post")
|
@app.get("/random_post")
|
||||||
@auth_desired
|
def random_post():
|
||||||
def random_post(v):
|
|
||||||
|
|
||||||
p = g.db.query(Submission.id).filter(Submission.deleted_utc == 0, Submission.is_banned == False, Submission.private == False).order_by(func.random()).first()
|
p = g.db.query(Submission.id).filter(Submission.deleted_utc == 0, Submission.is_banned == False, Submission.private == False).order_by(func.random()).first()
|
||||||
|
|
||||||
if p: p = p[0]
|
if p: p = p[0]
|
||||||
|
@ -375,8 +373,7 @@ def random_post(v):
|
||||||
|
|
||||||
|
|
||||||
@app.get("/random_user")
|
@app.get("/random_user")
|
||||||
@auth_desired
|
def random_user():
|
||||||
def random_user(v):
|
|
||||||
u = g.db.query(User.username).order_by(func.random()).first()
|
u = g.db.query(User.username).order_by(func.random()).first()
|
||||||
|
|
||||||
if u: u = u[0]
|
if u: u = u[0]
|
||||||
|
|
|
@ -110,15 +110,13 @@ def chart():
|
||||||
|
|
||||||
|
|
||||||
@app.get("/weekly_chart")
|
@app.get("/weekly_chart")
|
||||||
@auth_desired
|
def weekly_chart():
|
||||||
def weekly_chart(v):
|
|
||||||
file = cached_chart(kind="weekly", site=SITE)
|
file = cached_chart(kind="weekly", site=SITE)
|
||||||
f = send_file(file)
|
f = send_file(file)
|
||||||
return f
|
return f
|
||||||
|
|
||||||
@app.get("/daily_chart")
|
@app.get("/daily_chart")
|
||||||
@auth_desired
|
def daily_chart():
|
||||||
def daily_chart(v):
|
|
||||||
file = cached_chart(kind="daily", site=SITE)
|
file = cached_chart(kind="daily", site=SITE)
|
||||||
f = send_file(file)
|
f = send_file(file)
|
||||||
return f
|
return f
|
||||||
|
|
|
@ -516,8 +516,7 @@ def unsubscribe(v, post_id):
|
||||||
return {"message": "Post unsubscribed!"}
|
return {"message": "Post unsubscribed!"}
|
||||||
|
|
||||||
@app.get("/report_bugs")
|
@app.get("/report_bugs")
|
||||||
@auth_required
|
def reportbugs():
|
||||||
def reportbugs(v):
|
|
||||||
return redirect(f'/post/{BUG_THREAD}')
|
return redirect(f'/post/{BUG_THREAD}')
|
||||||
|
|
||||||
@app.post("/@<username>/message")
|
@app.post("/@<username>/message")
|
||||||
|
@ -714,15 +713,13 @@ def api_is_available(name):
|
||||||
else:
|
else:
|
||||||
return {name: True}
|
return {name: True}
|
||||||
|
|
||||||
@app.get("/id/<id>")
|
@app.get("/id/<int:id>")
|
||||||
@auth_desired
|
def user_id(id:int):
|
||||||
def user_id(v, id):
|
|
||||||
user = get_account(id)
|
user = get_account(id)
|
||||||
return redirect(user.url)
|
return redirect(user.url)
|
||||||
|
|
||||||
@app.get("/u/<username>")
|
@app.get("/u/<username>")
|
||||||
@auth_desired
|
def redditor_moment_redirect(username:str):
|
||||||
def redditor_moment_redirect(v, username):
|
|
||||||
return redirect(f"/@{username}")
|
return redirect(f"/@{username}")
|
||||||
|
|
||||||
@app.get("/@<username>/followers")
|
@app.get("/@<username>/followers")
|
||||||
|
@ -1009,8 +1006,7 @@ def user_profile_uid(v, id):
|
||||||
|
|
||||||
@app.get("/@<username>/pic")
|
@app.get("/@<username>/pic")
|
||||||
@limiter.exempt
|
@limiter.exempt
|
||||||
@auth_required
|
def user_profile_name(username:str):
|
||||||
def user_profile_name(v, username):
|
|
||||||
|
|
||||||
name = f"/@{username}/pic"
|
name = f"/@{username}/pic"
|
||||||
path = cache.get(name)
|
path = cache.get(name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue