remove unnecessary v shit
parent
9652c13286
commit
fca27c37eb
|
@ -207,7 +207,7 @@ class Comment(Base):
|
|||
elif self.parent_post: return f"p_{self.parent_post}"
|
||||
|
||||
@lazy
|
||||
def replies(self, sort, v):
|
||||
def replies(self, sort):
|
||||
if self.replies2 != None:
|
||||
return self.replies2
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ from files.__main__ import app, cache, limiter
|
|||
@app.get("/h/<sub>/post/<int:pid>/<anything>/<int:cid>")
|
||||
@limiter.limit(DEFAULT_RATELIMIT)
|
||||
@auth_desired_with_logingate
|
||||
def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
|
||||
def post_pid_comment_cid(cid, v, pid=None, anything=None, sub=None):
|
||||
|
||||
comment = get_comment(cid, v=v)
|
||||
if not User.can_see(v, comment): abort(403)
|
||||
|
|
|
@ -10,7 +10,7 @@ from files.__main__ import app
|
|||
@limiter.limit(DEFAULT_RATELIMIT)
|
||||
@limiter.limit(DEFAULT_RATELIMIT, key_func=get_ID)
|
||||
@auth_required
|
||||
def giphy(v=None, path=None):
|
||||
def giphy(v, path=None):
|
||||
|
||||
searchTerm = request.values.get("searchTerm", "").strip()
|
||||
limit = 48
|
||||
|
|
|
@ -85,7 +85,7 @@ def submit_get(v:User, sub=None):
|
|||
@app.get("/h/<sub>/post/<int:pid>/<anything>")
|
||||
@limiter.limit(DEFAULT_RATELIMIT)
|
||||
@auth_desired_with_logingate
|
||||
def post_id(pid, anything=None, v=None, sub=None):
|
||||
def post_id(pid, v, anything=None, sub=None):
|
||||
p = get_post(pid, v=v)
|
||||
if not User.can_see(v, p): abort(403)
|
||||
|
||||
|
@ -261,7 +261,7 @@ def more_comments(v, cid):
|
|||
comments = [c[0] for c in comments.all()]
|
||||
else:
|
||||
c = get_comment(cid)
|
||||
comments = c.replies(sort=request.values.get('sort'), v=v)
|
||||
comments = c.replies(sort=request.values.get('sort'))
|
||||
|
||||
if comments: p = comments[0].post
|
||||
else: p = None
|
||||
|
|
|
@ -677,7 +677,7 @@ def messagereply(v:User):
|
|||
admin_ids.append(parent.author.id)
|
||||
|
||||
#Don't delete unread notifications, so the replies don't get collapsed and they get highlighted
|
||||
ids = [top_comment.id] + [x.id for x in top_comment.replies(sort="old", v=v)]
|
||||
ids = [top_comment.id] + [x.id for x in top_comment.replies(sort="old")]
|
||||
notifications = g.db.query(Notification).filter(Notification.read == True, Notification.comment_id.in_(ids), Notification.user_id.in_(admin_ids))
|
||||
for n in notifications:
|
||||
g.db.delete(n)
|
||||
|
@ -1023,7 +1023,7 @@ def u_username(v:Optional[User], username:str):
|
|||
@app.get("/@<username>/comments")
|
||||
@limiter.limit(DEFAULT_RATELIMIT)
|
||||
@auth_required
|
||||
def u_username_comments(username, v=None):
|
||||
def u_username_comments(username, v):
|
||||
u = get_user(username, v=v, include_blocks=True)
|
||||
if username != u.username:
|
||||
return redirect(f"/@{u.username}/comments")
|
||||
|
@ -1088,7 +1088,7 @@ def u_username_comments(username, v=None):
|
|||
@limiter.limit(DEFAULT_RATELIMIT)
|
||||
@limiter.limit(DEFAULT_RATELIMIT, key_func=get_ID)
|
||||
@auth_required
|
||||
def u_username_info(username, v=None):
|
||||
def u_username_info(username, v):
|
||||
|
||||
user=get_user(username, v=v, include_blocks=True)
|
||||
|
||||
|
@ -1103,7 +1103,7 @@ def u_username_info(username, v=None):
|
|||
@limiter.limit(DEFAULT_RATELIMIT)
|
||||
@limiter.limit(DEFAULT_RATELIMIT, key_func=get_ID)
|
||||
@auth_required
|
||||
def u_user_id_info(id, v=None):
|
||||
def u_user_id_info(id, v):
|
||||
|
||||
user=get_account(id, v=v, include_blocks=True)
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
{% set score=ups-downs %}
|
||||
|
||||
{% if render_replies %}
|
||||
{% set replies=c.replies(sort=sort, v=v) %}
|
||||
{% set replies=c.replies(sort=sort) %}
|
||||
{% endif %}
|
||||
|
||||
{% if c.is_blocking and not c.ghost or (c.is_banned or c.deleted_utc) and not (v and v.admin_level >= PERMS['POST_COMMENT_MODERATION']) and not (v and v.id==c.author_id) %}
|
||||
|
|
Loading…
Reference in New Issue