forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-09-13 16:30:46 +02:00
parent 09312e41a6
commit 53f2fd466c
1 changed files with 4 additions and 3 deletions

View File

@ -373,14 +373,15 @@ class User(Base, Stndrd, Age_times):
def notification_messages(self, page=1):
comments = g.db.query(Comment).filter(or_(Comment.author_id==self.id, Comment.sentto==self.id), Comment.parent_submission == None).order_by(Comment.created_utc.desc()).all()
firstrange = 25 * (page - 1)
secondrange = firstrange + 26
comments2 = []
for c in comments:
if c.child_comments == []:
comments2.append(c.id)
if len(comments2) == 26: break
if len(comments2) == secondrange: break
firstrange = 25 * (page - 1)
secondrange = firstrange + 26
return comments2[firstrange:secondrange]
@property