forked from MarseyWorld/MarseyWorld
fds
parent
adf6d4bfee
commit
43366f4a28
|
@ -19,8 +19,6 @@ class Submission(Base):
|
||||||
__tablename__ = "submissions"
|
__tablename__ = "submissions"
|
||||||
|
|
||||||
id = Column(Integer, primary_key=True)
|
id = Column(Integer, primary_key=True)
|
||||||
if SITE in ('cringetopia.org','watchpeopledie.co'):
|
|
||||||
site = Column(Integer)
|
|
||||||
author_id = Column(Integer, ForeignKey("users.id"))
|
author_id = Column(Integer, ForeignKey("users.id"))
|
||||||
edited_utc = Column(Integer, default=0)
|
edited_utc = Column(Integer, default=0)
|
||||||
created_utc = Column(Integer)
|
created_utc = Column(Integer)
|
||||||
|
|
|
@ -318,9 +318,6 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
|
||||||
elif v.subs == 3:
|
elif v.subs == 3:
|
||||||
posts = posts.filter(Submission.sub != None, Submission.sub.notin_(v.all_blocks))
|
posts = posts.filter(Submission.sub != None, Submission.sub.notin_(v.all_blocks))
|
||||||
|
|
||||||
if site == 'cringetopia.org': posts = posts.filter_by(site=1)
|
|
||||||
elif site == 'watchpeopledie.co': posts = posts.filter_by(site=2)
|
|
||||||
|
|
||||||
if gt: posts = posts.filter(Submission.created_utc > gt)
|
if gt: posts = posts.filter(Submission.created_utc > gt)
|
||||||
if lt: posts = posts.filter(Submission.created_utc < lt)
|
if lt: posts = posts.filter(Submission.created_utc < lt)
|
||||||
|
|
||||||
|
@ -400,9 +397,6 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
|
||||||
if v and v.admin_level < 2:
|
if v and v.admin_level < 2:
|
||||||
pins = pins.filter(Submission.author_id.notin_(v.userblocks))
|
pins = pins.filter(Submission.author_id.notin_(v.userblocks))
|
||||||
|
|
||||||
if site == 'cringetopia.org': pins = pins.filter_by(site=1)
|
|
||||||
elif site == 'watchpeopledie.co': pins = pins.filter_by(site=2)
|
|
||||||
|
|
||||||
pins = pins.all()
|
pins = pins.all()
|
||||||
|
|
||||||
for pin in pins:
|
for pin in pins:
|
||||||
|
@ -557,11 +551,6 @@ def comment_idlist(page=1, v=None, nsfw=False, sort="new", t="all", gt=0, lt=0,
|
||||||
|
|
||||||
comments = g.db.query(Comment.id).filter(Comment.parent_submission != None)
|
comments = g.db.query(Comment.id).filter(Comment.parent_submission != None)
|
||||||
|
|
||||||
if site == 'cringetopia.org':
|
|
||||||
comments = comments.join(Submission, Comment.parent_submission == Submission.id).filter(Submission.site == 1)
|
|
||||||
elif site == 'watchpeopledie.co':
|
|
||||||
comments = comments.join(Submission, Comment.parent_submission == Submission.id).filter(Submission.site == 2)
|
|
||||||
|
|
||||||
if v.admin_level < 2:
|
if v.admin_level < 2:
|
||||||
private = [x[0] for x in g.db.query(Submission.id).filter(Submission.private == True).all()]
|
private = [x[0] for x in g.db.query(Submission.id).filter(Submission.private == True).all()]
|
||||||
|
|
||||||
|
|
|
@ -1128,9 +1128,6 @@ def submit_post(v, sub=None):
|
||||||
ghost=ghost
|
ghost=ghost
|
||||||
)
|
)
|
||||||
|
|
||||||
if SITE == 'cringetopia.org': post.site = 1
|
|
||||||
elif SITE == 'watchpeopledie.co': post.site = 2
|
|
||||||
|
|
||||||
g.db.add(post)
|
g.db.add(post)
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue