remove holes (#492)
* remove holes * don't import class that doesn't exist * remove subs in template code * remove subs_created * fix sticky bug * uh... i think this will fix it???? * fix stupid nearly ungrokkable nesting error * ... * .... * .... * *sigh* * .............................i think i got it. * Revert ".............................i think i got it." This reverts commit419a545875
. * Revert "*sigh*" This reverts commitfcfc9d7995
. * Revert "...." This reverts commite200c8f6f0
. * Revert "...." This reverts commit681db8cb02
. * Revert "..." This reverts commitc54372b9ff
. * Revert "fix stupid nearly ungrokkable nesting error" This reverts commite202fd774c
. * Revert "uh... i think this will fix it????" This reverts commite4d9366093
. * readd missing endif * fix email templates. * fix frontpage listing * some minor fixes wrt saving * fix some listing errors * Remove more references to holes system A couple of these came from the merge of #554. A few others were just left in the templates and presumably hard to catch on the first removal pass. * remove unnecessary lazy * Add migration Tested. Very sensitive to order. I wound up borrowing the statement order we used for deleting sub rows on upstream (manually, of course). --------- Co-authored-by: TLSM <duolsm@outlook.com>
This commit is contained in:
parent
1647b4cf20
commit
77af24a5b1
42 changed files with 226 additions and 1260 deletions
|
@ -1,12 +1,11 @@
|
|||
import time
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from flask import g
|
||||
from sqlalchemy import *
|
||||
from sqlalchemy.orm import (declared_attr, deferred, relationship,
|
||||
Session)
|
||||
from sqlalchemy.orm import Session, declared_attr, deferred, relationship
|
||||
|
||||
from files.classes.base import CreatedBase
|
||||
from files.classes.flags import Flag
|
||||
from files.classes.votes import Vote
|
||||
from files.helpers.assetcache import assetcache_path
|
||||
from files.helpers.config.const import *
|
||||
|
@ -16,8 +15,6 @@ from files.helpers.content import body_displayed
|
|||
from files.helpers.lazy import lazy
|
||||
from files.helpers.time import format_age, format_datetime
|
||||
|
||||
from .flags import Flag
|
||||
|
||||
|
||||
class Submission(CreatedBase):
|
||||
__tablename__ = "submissions"
|
||||
|
@ -34,7 +31,6 @@ class Submission(CreatedBase):
|
|||
distinguish_level = Column(Integer, default=0, nullable=False)
|
||||
stickied = Column(String)
|
||||
stickied_utc = Column(Integer)
|
||||
sub = Column(String, ForeignKey("subs.name"))
|
||||
is_pinned = Column(Boolean, default=False, nullable=False)
|
||||
private = Column(Boolean, default=False, nullable=False)
|
||||
club = Column(Boolean, default=False, nullable=False)
|
||||
|
@ -86,7 +82,6 @@ class Submission(CreatedBase):
|
|||
awards = relationship("AwardRelationship", viewonly=True)
|
||||
reports = relationship("Flag", viewonly=True)
|
||||
comments = relationship("Comment", primaryjoin="Comment.parent_submission==Submission.id")
|
||||
subr = relationship("Sub", primaryjoin="foreign(Submission.sub)==remote(Sub.name)", viewonly=True)
|
||||
notes = relationship("UserNote", back_populates="post")
|
||||
task = relationship("ScheduledSubmissionTask", back_populates="submissions")
|
||||
|
||||
|
@ -175,8 +170,6 @@ class Submission(CreatedBase):
|
|||
@lazy
|
||||
def shortlink(self):
|
||||
link = f"/post/{self.id}"
|
||||
if self.sub: link = f"/h/{self.sub}{link}"
|
||||
|
||||
if self.club: return link + '/-'
|
||||
|
||||
output = title_regex.sub('', self.title.lower())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue