give gambling badges for roulette too (testing on devrama)

pull/127/head
Aevann 2023-02-18 21:57:34 +02:00
parent fb758004c8
commit 835e1f6155
2 changed files with 5 additions and 0 deletions

View File

@ -22,6 +22,8 @@ class CasinoGame(Base):
kind = Column(String)
game_state = Column(JSON)
user = relationship("User")
def __init__(self, *args, **kwargs):
if "created_utc" not in kwargs:
kwargs["created_utc"] = int(time.time())

View File

@ -8,6 +8,7 @@ from flask import g
from files.classes.casino_game import CasinoGame
from files.helpers.alerts import *
from files.helpers.get import get_account
from files.helpers.casino import distribute_wager_badges
class RouletteAction(str, Enum):
STRAIGHT_UP_BET = "STRAIGHT_UP_BET",
@ -209,6 +210,8 @@ def spin_roulette_wheel():
else:
game.winnings = -game.wager
distribute_wager_badges(game.user, game.wager, won=(game.winnings > 0))
game.active = False
g.db.add(game)