forked from rDrama/rDrama
dfdf
parent
9b9ede0dc3
commit
fc7bd22094
|
@ -193,7 +193,7 @@ class User(Base, Stndrd, Age_times):
|
||||||
|
|
||||||
@cache.memoize(300)
|
@cache.memoize(300)
|
||||||
def commentlisting(self, v=None, page=1, sort="new", t="all"):
|
def commentlisting(self, v=None, page=1, sort="new", t="all"):
|
||||||
comments = self.comments.options(lazyload('*')).filter(Comment.parent_submission is not None).join(Comment.post)
|
comments = self.comments.options(lazyload('*')).filter(Comment.parent_submission != None).join(Comment.post)
|
||||||
|
|
||||||
if (not v) or (v.id != self.id and v.admin_level == 0):
|
if (not v) or (v.id != self.id and v.admin_level == 0):
|
||||||
comments = comments.filter(Comment.deleted_utc == 0)
|
comments = comments.filter(Comment.deleted_utc == 0)
|
||||||
|
|
|
@ -25,7 +25,7 @@ from drama.__main__ import app, cache
|
||||||
@admin_level_required(6)
|
@admin_level_required(6)
|
||||||
def counts_comments(v):
|
def counts_comments(v):
|
||||||
for u in g.db.query(User).all():
|
for u in g.db.query(User).all():
|
||||||
u.comment_count = u.comments.filter(Comment.is_banned==False, Comment.deleted_utc==0, Comment.parent_submission is not None).count()
|
u.comment_count = u.comments.filter(Comment.is_banned==False, Comment.deleted_utc==0, Comment.parent_submission != None).count()
|
||||||
g.db.add(u)
|
g.db.add(u)
|
||||||
return "sex"
|
return "sex"
|
||||||
|
|
||||||
|
@ -1046,7 +1046,7 @@ def user_stat_data(v):
|
||||||
|
|
||||||
user_stats = {'current_users': g.db.query(User).filter_by(is_banned=0, reserved=None).count(),
|
user_stats = {'current_users': g.db.query(User).filter_by(is_banned=0, reserved=None).count(),
|
||||||
'banned_users': g.db.query(User).filter(User.is_banned != 0).count(),
|
'banned_users': g.db.query(User).filter(User.is_banned != 0).count(),
|
||||||
'reserved_users': g.db.query(User).filter(User.reserved is not None).count(),
|
'reserved_users': g.db.query(User).filter(User.reserved != None).count(),
|
||||||
'email_verified_users': g.db.query(User).filter_by(is_banned=0, is_activated=True).count(),
|
'email_verified_users': g.db.query(User).filter_by(is_banned=0, is_activated=True).count(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ def settings_profile_post(v):
|
||||||
updated = True
|
updated = True
|
||||||
v.is_nofollow = request.values.get("nofollow", None) == 'true'
|
v.is_nofollow = request.values.get("nofollow", None) == 'true'
|
||||||
|
|
||||||
if request.values.get("bio") is not None:
|
if request.values.get("bio"):
|
||||||
bio = request.values.get("bio")[0:1500]
|
bio = request.values.get("bio")[0:1500]
|
||||||
|
|
||||||
if bio == v.bio:
|
if bio == v.bio:
|
||||||
|
@ -96,7 +96,7 @@ def settings_profile_post(v):
|
||||||
v=v,
|
v=v,
|
||||||
msg="Your bio has been updated.")
|
msg="Your bio has been updated.")
|
||||||
|
|
||||||
if request.values.get("filters") is not None:
|
if request.values.get("filters"):
|
||||||
|
|
||||||
filters=request.values.get("filters")[0:1000].strip()
|
filters=request.values.get("filters")[0:1000].strip()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue