Merge branch 'frost' into upgrade-to-sqlalchemy2

This commit is contained in:
justcool393 2023-08-09 00:30:15 -07:00 committed by GitHub
commit 3e66d8a7bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 71 additions and 202 deletions

View file

@ -34,7 +34,6 @@ class Submission(CreatedBase):
stickied_utc: Mapped[int | None] = mapped_column(Integer)
is_pinned: Mapped[bool] = mapped_column(Boolean, default=False, nullable=False)
private: Mapped[bool] = mapped_column(Boolean, default=False, nullable=False)
club = Column(Boolean, default=False, nullable=False)
comment_count: Mapped[int] = mapped_column(Integer, default=0, nullable=False)
over_18: Mapped[bool] = mapped_column(Boolean, default=False, nullable=False)
is_bot: Mapped[bool] = mapped_column(Boolean, default=False, nullable=False)
@ -172,7 +171,6 @@ class Submission(CreatedBase):
@lazy
def shortlink(self):
link = f"/post/{self.id}"
if self.club: return link + '/-'
output = title_regex.sub('', self.title.lower())
output = output.split()[:6]
@ -253,7 +251,6 @@ class Submission(CreatedBase):
'distinguish_level': self.distinguish_level,
'voted': self.voted if hasattr(self, 'voted') else 0,
'flags': flags,
'club': self.club,
}
return data