forked from MarseyWorld/MarseyWorld
master
parent
93fa545ffb
commit
b4287b2477
|
@ -46,7 +46,7 @@ class Submission(Base):
|
|||
deleted_utc = Column(Integer, default=0)
|
||||
distinguish_level = Column(Integer, default=0)
|
||||
created_str = Column(String(255))
|
||||
stickied = Column(Boolean, default=False)
|
||||
stickied = Column(String)
|
||||
is_pinned = Column(Boolean, default=False)
|
||||
private = Column(Boolean, default=False)
|
||||
club = Column(Boolean, default=False)
|
||||
|
|
|
@ -971,7 +971,7 @@ def ban_post(post_id, v):
|
|||
|
||||
post.is_banned = True
|
||||
post.is_approved = 0
|
||||
post.stickied = False
|
||||
post.stickied = None
|
||||
post.is_pinned = False
|
||||
post.removed_by = v.id
|
||||
|
||||
|
@ -1066,7 +1066,8 @@ def api_sticky_post(post_id, v):
|
|||
|
||||
post = g.db.query(Submission).options(lazyload('*')).filter_by(id=post_id).first()
|
||||
if post:
|
||||
post.stickied = not (post.stickied)
|
||||
if post.stickied: post.stickied = None
|
||||
else: post.stickied = v.username
|
||||
g.db.add(post)
|
||||
|
||||
ma=ModAction(
|
||||
|
|
|
@ -131,7 +131,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
|
|||
cutoff = now - 31536000
|
||||
posts = posts.filter(Submission.created_utc >= cutoff)
|
||||
|
||||
posts = posts.filter_by(is_banned=False,stickied=False,private=False,deleted_utc = 0)
|
||||
posts = posts.filter_by(is_banned=False, stickied=None, private=False, deleted_utc = 0)
|
||||
|
||||
if v:
|
||||
posts = posts.filter(or_(Submission.processing == False, Submission.author_id == v.id))
|
||||
|
@ -198,7 +198,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
|
|||
|
||||
posts = posts[:25]
|
||||
|
||||
if page == 1: posts = g.db.query(Submission).options(lazyload('*')).filter_by(stickied=True).all() + posts
|
||||
if page == 1: posts = g.db.query(Submission).options(lazyload('*')).filter(Submission.stickied != None).all() + posts
|
||||
|
||||
if ids_only: posts = [x.id for x in posts]
|
||||
|
||||
|
|
|
@ -1100,7 +1100,7 @@ def delete_post_pid(pid, v):
|
|||
|
||||
post.deleted_utc = int(time.time())
|
||||
post.is_pinned = False
|
||||
post.stickied = False
|
||||
post.stickied = None
|
||||
|
||||
g.db.add(post)
|
||||
|
||||
|
|
Loading…
Reference in New Issue