forked from rDrama/rDrama
1
0
Fork 0

fix chudrama for paypigs

master
Aevann1 2022-08-31 18:49:31 +02:00
parent 948972945a
commit 04e47017c1
5 changed files with 13 additions and 9 deletions

View File

@ -90,9 +90,7 @@ class Comment(Base):
if not self.parent_submission: return True
if self.post.sub != 'chudrama': return True
if v:
if v.truecoins >= 5000: return True
if v.agendaposter: return True
if v.patron: return True
if v.can_see_chudrama: return True
if v.id == self.author_id: return True
if v.id == self.post.author_id: return True
return False

View File

@ -82,9 +82,7 @@ class Submission(Base):
if SITE != 'rdrama.net': return True
if self.sub != 'chudrama': return True
if v:
if v.truecoins >= 5000: return True
if v.agendaposter: return True
if v.patron: return True
if v.can_see_chudrama: return True
if v.id == self.author_id: return True
return False

View File

@ -822,4 +822,12 @@ class User(Base):
return 'Contributed at least $50'
if self.patron == 5:
return 'Contributed at least $100'
return ''
return ''
@property
@lazy
def can_see_chudrama(self):
if self.truecoins >= 5000: return True
if self.agendaposter: return True
if self.patron: return True
return False

View File

@ -300,7 +300,7 @@ def comment(v):
body_html = sanitize(body_for_sanitize, limit_pings=5)
if parent_post.id not in ADMIGGERS and '!slots' not in body.lower() and '!blackjack' not in body.lower() and '!wordle' not in body.lower() and AGENDAPOSTER_PHRASE not in body.lower() and parent_post.sub != 'chudrama':
if parent_post.id not in ADMIGGERS and '!slots' not in body.lower() and '!blackjack' not in body.lower() and '!wordle' not in body.lower() and AGENDAPOSTER_PHRASE not in body.lower():
existing = g.db.query(Comment.id).filter(Comment.author_id == v.id,
Comment.deleted_utc == 0,
Comment.parent_comment_id == parent_comment_id,

View File

@ -29,7 +29,7 @@ def front_all(v, sub=None, subdomain=None):
if sub:
sub = sub.strip().lower()
if sub == 'chudrama' and not (v and v.truecoins >= 5000): abort(403)
if sub == 'chudrama' and not (v and v.can_see_chudrama): abort(403)
sub = g.db.query(Sub).filter_by(name=sub).one_or_none()
if (request.path.startswith('/h/') or request.path.startswith('/s/')) and not sub: abort(404)