forked from MarseyWorld/MarseyWorld
change "king" award to "gold" award
parent
74e9812e4d
commit
6c403fcb18
|
@ -69,7 +69,6 @@ class Badge(Base):
|
|||
if self.badge_id == 281: return self.user.namechanged
|
||||
if self.badge_id == 285: return self.user.queen
|
||||
if self.badge_id == 289: return self.user.sharpen
|
||||
if self.badge_id == 302: return self.user.king
|
||||
|
||||
return None
|
||||
|
||||
|
|
|
@ -26,10 +26,10 @@ def get_award_classes(obj, v, title=False):
|
|||
if not (v and v.poor):
|
||||
if obj.award_count('glowie', v):
|
||||
classes.append("glow")
|
||||
if obj.award_count('gold', v):
|
||||
classes.append("gold-text")
|
||||
if obj.rainbowed:
|
||||
classes.append("rainbow-text")
|
||||
# if obj.golden:
|
||||
# classes.append("gold-text")
|
||||
if obj.queened:
|
||||
classes.append("queen")
|
||||
if obj.sharpened:
|
||||
|
@ -197,7 +197,6 @@ class Comment(Base):
|
|||
casino_game_id = Column(Integer, ForeignKey("casino_games.id"))
|
||||
chudded = Column(Boolean, default=False)
|
||||
rainbowed = Column(Boolean, default=False)
|
||||
golden = Column(Boolean, default=False)
|
||||
queened = Column(Boolean, default=False)
|
||||
sharpened = Column(Boolean, default=False)
|
||||
|
||||
|
|
|
@ -63,7 +63,6 @@ class Post(Base):
|
|||
notify = Column(Boolean)
|
||||
chudded = Column(Boolean, default=False)
|
||||
rainbowed = Column(Boolean, default=False)
|
||||
golden = Column(Boolean, default=False)
|
||||
queened = Column(Boolean, default=False)
|
||||
sharpened = Column(Boolean, default=False)
|
||||
ping_cost = Column(Integer, default=0)
|
||||
|
|
|
@ -90,7 +90,6 @@ class User(Base):
|
|||
lootboxes_bought = Column(Integer, default=0)
|
||||
chud = Column(Integer, default=0)
|
||||
queen = Column(Integer, default=0)
|
||||
king = Column(Integer, default=0)
|
||||
chud_phrase = Column(String)
|
||||
email_verified = Column(Boolean, default=False)
|
||||
shadowbanned = Column(Integer, ForeignKey("users.id"))
|
||||
|
|
|
@ -540,6 +540,19 @@ AWARDS = {
|
|||
"ghost": True,
|
||||
"enabled": True,
|
||||
"positive": False,
|
||||
},
|
||||
"gold": {
|
||||
"kind": "gold",
|
||||
"title": "Gold",
|
||||
"description": "Gold is a virtual good you can use on Reddit to reward, recognize, and celebrate content from redditors you love. If you like a post or comment and want to show your appreciation for it, you can give it gold. This will help the post or comment stand out on Reddit.",
|
||||
"icon": "fas fa-coin",
|
||||
"color": "text-gold",
|
||||
"price": 500,
|
||||
"deflectable": False,
|
||||
"cosmetic": True,
|
||||
"ghost": True,
|
||||
"enabled": True,
|
||||
"positive": True,
|
||||
},
|
||||
"spider": {
|
||||
"kind": "spider",
|
||||
|
@ -605,19 +618,6 @@ AWARDS = {
|
|||
"ghost": False,
|
||||
"enabled": True,
|
||||
"positive": False,
|
||||
},
|
||||
"king": {
|
||||
"kind": "king",
|
||||
"title": "King",
|
||||
"description": "Gives the recipient golden text for 24 hours.",
|
||||
"icon": "fas fa-crown",
|
||||
"color": "text-gold",
|
||||
"price": 1000,
|
||||
"deflectable": True,
|
||||
"cosmetic": False,
|
||||
"ghost": False,
|
||||
"enabled": True,
|
||||
"positive": True,
|
||||
},
|
||||
"queen": {
|
||||
"kind": "queen",
|
||||
|
|
|
@ -174,7 +174,6 @@ def _create_post(title, body, pin_hours):
|
|||
ghost=False,
|
||||
chudded=False,
|
||||
rainbowed=False,
|
||||
golden=False,
|
||||
queened=False,
|
||||
sharpened=False,
|
||||
stickied_utc=stickied_utc,
|
||||
|
@ -405,7 +404,6 @@ def _award_timers_task():
|
|||
_process_timer(User.marsify, [170], "The marsify award you received has expired!")
|
||||
_process_timer(User.rainbow, [171], "The rainbow award you received has expired!")
|
||||
_process_timer(User.queen, [285], "The queen award you received has expired!")
|
||||
_process_timer(User.king, [302], "The king award you received has expired!")
|
||||
_process_timer(User.spider, [179], "The spider award you received has expired!")
|
||||
_process_timer(User.namechanged, [281], "The namelock award you received has expired. You're now back to your old username!", {
|
||||
User.username: User.prelock_username,
|
||||
|
|
|
@ -540,13 +540,6 @@ def award_thing(v, thing_type, id):
|
|||
if thing_type == 'comment' and (not thing.author.deflector or v == thing.author):
|
||||
thing.rainbowed = True
|
||||
g.db.add(thing)
|
||||
elif kind == 'king':
|
||||
if author.king: author.king += 86400
|
||||
else: author.king = int(time.time()) + 86400
|
||||
badge_grant(user=author, badge_id=302)
|
||||
if thing_type == 'comment' and (not thing.author.deflector or v == thing.author):
|
||||
thing.golden = True
|
||||
g.db.add(thing)
|
||||
elif kind == "emoji":
|
||||
award.note = award.note.strip(":").lower()
|
||||
emoji = g.db.query(Emoji).filter_by(name=award.note).one_or_none()
|
||||
|
|
|
@ -277,7 +277,6 @@ def comment(v):
|
|||
ghost=ghost,
|
||||
chudded=chudded,
|
||||
rainbowed=bool(v.rainbow),
|
||||
golden=bool(v.king),
|
||||
queened=bool(v.queen),
|
||||
sharpened=bool(v.sharpen),
|
||||
)
|
||||
|
|
|
@ -571,7 +571,6 @@ def submit_post(v, sub=None):
|
|||
ghost=flag_ghost,
|
||||
chudded=flag_chudded,
|
||||
rainbowed=bool(v.rainbow),
|
||||
golden=bool(v.king),
|
||||
queened=bool(v.queen),
|
||||
sharpened=bool(v.sharpen),
|
||||
)
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
delete from badges where badge_id=302;
|
||||
delete from badge_defs where id=302;
|
||||
|
||||
alter table users drop column king;
|
||||
alter table posts drop column golden;
|
||||
alter table comments drop column golden;
|
Loading…
Reference in New Issue