From d666bfaa9573b300e6f504084737f36f755d4cb8 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 20 Sep 2021 23:19:33 +0200 Subject: [PATCH] fdsfs --- files/classes/submission.py | 12 +----------- files/classes/user.py | 5 ++--- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/files/classes/submission.py b/files/classes/submission.py index 9bac7f608..ca2ad1d73 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -512,14 +512,4 @@ class SaveRelationship(Base): id=Column(Integer, primary_key=true) user_id=Column(Integer, ForeignKey("users.id")) submission_id=Column(Integer, ForeignKey("submissions.id")) - type=Column(Integer) - - @property - @lazy - def created_date(self): - return time.strftime("%d %B %Y", time.gmtime(self.created_utc)) - - @property - @lazy - def created_datetime(self): - return str(time.strftime("%d/%B/%Y %H:%M:%S UTC", time.gmtime(self.created_utc))) + type=Column(Integer) \ No newline at end of file diff --git a/files/classes/user.py b/files/classes/user.py index 3bb624f50..44045ea89 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -559,9 +559,7 @@ class User(Base): @lazy def saved_idlist(self, page=1): - posts = g.db.query(Submission.id).options(lazyload('*')).options(lazyload('*')).filter_by(is_banned=False, - deleted_utc=0 - ) + posts = g.db.query(Submission.id).options(lazyload('*')).options(lazyload('*')).filter_by(is_banned=False, deleted_utc=0) saved = [x[0] for x in g.db.query(SaveRelationship.submission_id).options(lazyload('*')).filter(SaveRelationship.user_id == self.id).all()] posts = posts.filter(Submission.id.in_(saved)) @@ -583,6 +581,7 @@ class User(Base): return [x[0] for x in posts.offset(25 * (page - 1)).limit(26).all()] + @lazy def saved_comment_idlist(self, page=1): comments = g.db.query(Comment.id).options(lazyload('*')).options(lazyload('*')).filter_by(is_banned=False, deleted_utc=0)