forked from rDrama/rDrama
fdfd
parent
5cdbb82824
commit
511144998a
|
@ -350,6 +350,7 @@ class User(Base, Stndrd, Age_times):
|
||||||
return self.notifications.filter(Notification.read == False).join(Notification.comment).filter(
|
return self.notifications.filter(Notification.read == False).join(Notification.comment).filter(
|
||||||
Comment.author_id == AUTOJANNY_ACCOUNT).count()
|
Comment.author_id == AUTOJANNY_ACCOUNT).count()
|
||||||
|
|
||||||
|
@lazy
|
||||||
def notification_subscriptions(self, page=1, all_=False):
|
def notification_subscriptions(self, page=1, all_=False):
|
||||||
|
|
||||||
notifications = self.notifications.join(Notification.comment).filter(Comment.author_id == AUTOJANNY_ACCOUNT)
|
notifications = self.notifications.join(Notification.comment).filter(Comment.author_id == AUTOJANNY_ACCOUNT)
|
||||||
|
@ -368,6 +369,7 @@ class User(Base, Stndrd, Age_times):
|
||||||
|
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
@lazy
|
||||||
def notification_commentlisting(self, page=1, all_=False):
|
def notification_commentlisting(self, page=1, all_=False):
|
||||||
|
|
||||||
notifications = self.notifications.join(Notification.comment).filter(
|
notifications = self.notifications.join(Notification.comment).filter(
|
||||||
|
|
|
@ -24,7 +24,7 @@ def notifications(v):
|
||||||
messages = request.args.get('messages', False)
|
messages = request.args.get('messages', False)
|
||||||
posts = request.args.get('posts', False)
|
posts = request.args.get('posts', False)
|
||||||
if messages:
|
if messages:
|
||||||
if v.admin_level == 6: comments = g.db.query(Comment).filter(or_(Comment.author_id==v.id, Comment.sentto==v.id, Comment.sentto==0)).filter(Comment.parent_submission == None).order_by(Comment.created_utc.desc()).offset(25 * (page - 1)).limit(26).all()
|
if v.admin_level == 6: comments = g.db.query(Comment).filter(Comment.child_comments is None, or_(Comment.author_id==v.id, Comment.sentto==v.id, Comment.sentto==0)).filter(Comment.parent_submission == None).order_by(Comment.created_utc.desc()).offset(25 * (page - 1)).limit(26).all()
|
||||||
else: comments = g.db.query(Comment).filter(or_(Comment.author_id==v.id, Comment.sentto==v.id)).filter(Comment.parent_submission == None).order_by(Comment.created_utc.desc()).offset(25 * (page - 1)).limit(26).all()
|
else: comments = g.db.query(Comment).filter(or_(Comment.author_id==v.id, Comment.sentto==v.id)).filter(Comment.parent_submission == None).order_by(Comment.created_utc.desc()).offset(25 * (page - 1)).limit(26).all()
|
||||||
next_exists = (len(comments) == 26)
|
next_exists = (len(comments) == 26)
|
||||||
comments = comments[:25]
|
comments = comments[:25]
|
||||||
|
|
Loading…
Reference in New Issue