forked from MarseyWorld/MarseyWorld
fix 500 error
parent
4e5766d454
commit
b0976c5f54
|
@ -166,7 +166,6 @@ def upvoters_downvoters(v, username, username2, cls, vote_cls, vote_dir, templat
|
||||||
page = get_page()
|
page = get_page()
|
||||||
|
|
||||||
listing = g.db.query(cls).options(load_only(cls.id)).join(vote_cls).filter(
|
listing = g.db.query(cls).options(load_only(cls.id)).join(vote_cls).filter(
|
||||||
cls.draft == False,
|
|
||||||
cls.ghost == False,
|
cls.ghost == False,
|
||||||
cls.is_banned == False,
|
cls.is_banned == False,
|
||||||
cls.deleted_utc == 0,
|
cls.deleted_utc == 0,
|
||||||
|
@ -175,6 +174,9 @@ def upvoters_downvoters(v, username, username2, cls, vote_cls, vote_dir, templat
|
||||||
vote_cls.user_id == uid,
|
vote_cls.user_id == uid,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if cls == Post:
|
||||||
|
listing = listing.filter_by(private=False)
|
||||||
|
|
||||||
total = listing.count()
|
total = listing.count()
|
||||||
|
|
||||||
listing = listing.order_by(cls.created_utc.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
|
listing = listing.order_by(cls.created_utc.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
|
||||||
|
@ -230,7 +232,6 @@ def upvoting_downvoting(v, username, username2, cls, vote_cls, vote_dir, templat
|
||||||
page = get_page()
|
page = get_page()
|
||||||
|
|
||||||
listing = g.db.query(cls).options(load_only(cls.id)).join(vote_cls).filter(
|
listing = g.db.query(cls).options(load_only(cls.id)).join(vote_cls).filter(
|
||||||
cls.draft == False,
|
|
||||||
cls.ghost == False,
|
cls.ghost == False,
|
||||||
cls.is_banned == False,
|
cls.is_banned == False,
|
||||||
cls.deleted_utc == 0,
|
cls.deleted_utc == 0,
|
||||||
|
@ -239,6 +240,9 @@ def upvoting_downvoting(v, username, username2, cls, vote_cls, vote_dir, templat
|
||||||
cls.author_id == uid,
|
cls.author_id == uid,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if cls == Post:
|
||||||
|
listing = listing.filter_by(private=False)
|
||||||
|
|
||||||
total = listing.count()
|
total = listing.count()
|
||||||
|
|
||||||
listing = listing.order_by(cls.created_utc.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
|
listing = listing.order_by(cls.created_utc.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
|
||||||
|
|
Loading…
Reference in New Issue