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 commit 419a545875.

* Revert "*sigh*"

This reverts commit fcfc9d7995.

* Revert "...."

This reverts commit e200c8f6f0.

* Revert "...."

This reverts commit 681db8cb02.

* Revert "..."

This reverts commit c54372b9ff.

* Revert "fix stupid nearly ungrokkable nesting error"

This reverts commit e202fd774c.

* Revert "uh... i think this will fix it????"

This reverts commit e4d9366093.

* 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:
justcool393 2023-03-31 22:13:30 -07:00 committed by GitHub
parent 1647b4cf20
commit 77af24a5b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
42 changed files with 226 additions and 1260 deletions

View file

@ -21,7 +21,7 @@ USERPAGELISTING_TIMEOUT_SECS: Final[int] = 86400
CHANGELOGLIST_TIMEOUT_SECS: Final[int] = 86400
@cache.memoize(timeout=FRONTLIST_TIMEOUT_SECS)
def frontlist(v=None, sort='new', page=1, t="all", ids_only=True, ccmode="false", filter_words='', gt=0, lt=0, sub=None, site=None):
def frontlist(v=None, sort='new', page=1, t="all", ids_only=True, ccmode="false", filter_words='', gt=0, lt=0):
posts = g.db.query(Submission)
if v and v.hidevotedon:
@ -34,9 +34,6 @@ def frontlist(v=None, sort='new', page=1, t="all", ids_only=True, ccmode="false"
filter_clause = filter_clause | (Submission.author_id == v.id)
posts = posts.filter(filter_clause)
if sub: posts = posts.filter_by(sub=sub.name)
elif v: posts = posts.filter((Submission.sub == None) | Submission.sub.notin_(v.all_blocks))
if gt: posts = posts.filter(Submission.created_utc > gt)
if lt: posts = posts.filter(Submission.created_utc < lt)
@ -80,9 +77,7 @@ def frontlist(v=None, sort='new', page=1, t="all", ids_only=True, ccmode="false"
if page == 1 and ccmode == "false" and not gt and not lt:
pins = g.db.query(Submission).filter(Submission.stickied != None, Submission.is_banned == False)
if sub: pins = pins.filter_by(sub=sub.name)
elif v:
pins = pins.filter((Submission.sub == None) | Submission.sub.notin_(v.all_blocks))
if v:
if v.admin_level < 2:
pins = pins.filter(Submission.author_id.notin_(v.userblocks))
@ -105,7 +100,7 @@ def frontlist(v=None, sort='new', page=1, t="all", ids_only=True, ccmode="false"
@cache.memoize(timeout=USERPAGELISTING_TIMEOUT_SECS)
def userpagelisting(u:User, site=None, v=None, page=1, sort="new", t="all"):
def userpagelisting(u:User, v=None, page=1, sort="new", t="all"):
if u.shadowbanned and not (v and (v.admin_level > 1 or v.id == u.id)): return []
posts = g.db.query(Submission.id).filter_by(author_id=u.id, is_pinned=False)
@ -122,7 +117,7 @@ def userpagelisting(u:User, site=None, v=None, page=1, sort="new", t="all"):
@cache.memoize(timeout=CHANGELOGLIST_TIMEOUT_SECS)
def changeloglist(v=None, sort="new", page=1, t="all", site=None):
def changeloglist(v=None, sort="new", page=1, t="all"):
posts = g.db.query(Submission.id).filter_by(is_banned=False, private=False,).filter(Submission.deleted_utc == 0)
if v.admin_level < 2: