forked from rDrama/rDrama
Merge branch 'master' of https://github.com/Aevann1/Drama into snow
commit
ffc4108d24
|
@ -265,14 +265,14 @@ class Comment(Base):
|
|||
data= {'is_banned': True,
|
||||
'ban_reason': self.ban_reason,
|
||||
'id': self.id,
|
||||
'post': self.post.id,
|
||||
'post': self.post.id if self.post else 0,
|
||||
'level': self.level,
|
||||
'parent': self.parent_fullname
|
||||
}
|
||||
elif self.deleted_utc > 0:
|
||||
data= {'deleted_utc': self.deleted_utc,
|
||||
'id': self.id,
|
||||
'post': self.post.id,
|
||||
'post': self.post.id if self.post else 0,
|
||||
'level': self.level,
|
||||
'parent': self.parent_fullname
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ def auth_desired(f):
|
|||
|
||||
v = get_logged_in_user()
|
||||
|
||||
if request.host == 'old.rdrama.net' and not (v and v.admin_level):
|
||||
if request.host == 'old.rdrama.net' and not (v and v.admin_level) and '/login' not in request.path:
|
||||
if request.headers.get("Authorization"): return {"error": "403 Forbidden"}, 403
|
||||
else: return render_template('errors/403.html', v=v), 403
|
||||
check_ban_evade(v)
|
||||
|
|
|
@ -105,6 +105,7 @@ def notifications(v):
|
|||
if c not in listing:
|
||||
listing.append(c)
|
||||
|
||||
if request.headers.get("Authorization"): return {"data":[x.json for x in listing]}
|
||||
|
||||
return render_template("notifications.html",
|
||||
v=v,
|
||||
|
|
|
@ -249,7 +249,7 @@ def searchcomments(v):
|
|||
|
||||
comments = get_comments(ids, v=v)
|
||||
|
||||
if request.headers.get("Authorization"): return [x.json for x in comments]
|
||||
if request.headers.get("Authorization"): return {"data":[x.json for x in comments]}
|
||||
else: return render_template("search_comments.html", v=v, query=query, total=total, page=page, comments=comments, sort=sort, t=t, next_exists=next_exists)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue