forked from MarseyWorld/MarseyWorld
Merge branch 'frost' of https://github.com/Aevann1/rDrama into frost
commit
d18e247513
|
@ -290,6 +290,14 @@ class User(Base):
|
||||||
if self.bite: return "565656"
|
if self.bite: return "565656"
|
||||||
return self.namecolor
|
return self.namecolor
|
||||||
|
|
||||||
|
@property
|
||||||
|
@lazy
|
||||||
|
def is_votes_real(self):
|
||||||
|
if self.is_suspended_permanently or self.shadowbanned: return False
|
||||||
|
if self.agendaposter: return False
|
||||||
|
if self.profile_url.startswith('/e/') and not self.customtitle and self.namecolor == DEFAULT_COLOR: return False
|
||||||
|
return True
|
||||||
|
|
||||||
@lazy
|
@lazy
|
||||||
def mods(self, sub):
|
def mods(self, sub):
|
||||||
if self.is_suspended_permanently or self.shadowbanned: return False
|
if self.is_suspended_permanently or self.shadowbanned: return False
|
||||||
|
|
|
@ -121,19 +121,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
|
||||||
if v: size = v.frontsize or 0
|
if v: size = v.frontsize or 0
|
||||||
else: size = 25
|
else: size = 25
|
||||||
|
|
||||||
if False:
|
posts = posts.offset(size * (page - 1)).limit(size+1).all()
|
||||||
posts = posts.offset(size * (page - 1)).limit(100).all()
|
|
||||||
social_found = False
|
|
||||||
music_found = False
|
|
||||||
for post in posts:
|
|
||||||
if post.sub == 'social':
|
|
||||||
if social_found: posts.remove(post)
|
|
||||||
else: social_found = True
|
|
||||||
elif post.sub == 'music':
|
|
||||||
if music_found: posts.remove(post)
|
|
||||||
else: music_found = True
|
|
||||||
else:
|
|
||||||
posts = posts.offset(size * (page - 1)).limit(size+1).all()
|
|
||||||
|
|
||||||
next_exists = (len(posts) > size)
|
next_exists = (len(posts) > size)
|
||||||
|
|
||||||
|
|
|
@ -98,9 +98,7 @@ def vote_post_comment(target_id, new, v, cls, vote_cls):
|
||||||
target.author.truecoins += coin_delta
|
target.author.truecoins += coin_delta
|
||||||
g.db.add(target.author)
|
g.db.add(target.author)
|
||||||
|
|
||||||
if new == 1 and (v.agendaposter or v.shadowbanned or (v.is_banned and not v.unban_utc) or (v.profile_url.startswith('/e/') and not v.customtitle and v.namecolor == DEFAULT_COLOR)): real = False
|
real = new != 1 or v.is_votes_real
|
||||||
else: real = True
|
|
||||||
|
|
||||||
vote = None
|
vote = None
|
||||||
if vote_cls == Vote:
|
if vote_cls == Vote:
|
||||||
vote = Vote(user_id=v.id,
|
vote = Vote(user_id=v.id,
|
||||||
|
|
Loading…
Reference in New Issue