forked from rDrama/rDrama
better v.poor code
parent
4c9858f143
commit
443615e14f
|
@ -253,6 +253,11 @@ class User(Base):
|
||||||
|
|
||||||
return (succeeded, charged_coins)
|
return (succeeded, charged_coins)
|
||||||
|
|
||||||
|
@property
|
||||||
|
@lazy
|
||||||
|
def poor(self):
|
||||||
|
return session.get('poor')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def num_of_bought_awards(self):
|
def num_of_bought_awards(self):
|
||||||
|
|
|
@ -138,8 +138,7 @@ def settings_personal_post(v):
|
||||||
v.reddit = reddit
|
v.reddit = reddit
|
||||||
elif request.values.get("poor", v.poor) != v.poor:
|
elif request.values.get("poor", v.poor) != v.poor:
|
||||||
updated = True
|
updated = True
|
||||||
v.poor = request.values.get("poor", v.poor) == 'true'
|
session['poor'] = request.values.get("poor", v.poor) == 'true'
|
||||||
session['poor'] = v.poor
|
|
||||||
|
|
||||||
slur_filter_updated = updated or update_potentially_permanent_flag("slurreplacer", "slurreplacer", "slur replacer", 192)
|
slur_filter_updated = updated or update_potentially_permanent_flag("slurreplacer", "slurreplacer", "slur replacer", 192)
|
||||||
if isinstance(slur_filter_updated, bool):
|
if isinstance(slur_filter_updated, bool):
|
||||||
|
|
|
@ -108,7 +108,6 @@ def get_logged_in_user():
|
||||||
g.v = v
|
g.v = v
|
||||||
|
|
||||||
if v:
|
if v:
|
||||||
v.poor = session.get('poor')
|
|
||||||
# Check against last_active + ACTIVE_TIME to reduce frequency of
|
# Check against last_active + ACTIVE_TIME to reduce frequency of
|
||||||
# UPDATEs in exchange for a ±ACTIVE_TIME margin of error.
|
# UPDATEs in exchange for a ±ACTIVE_TIME margin of error.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue