Merge branch 'master' of https://github.com/Aevann1/Drama into snow

remotes/1693045480750635534/spooky-22
Aevann1 2021-12-15 00:11:48 +02:00
commit 44b629338b
4 changed files with 15 additions and 3 deletions

View File

@ -68,6 +68,7 @@ class User(Base):
fail2_utc = Column(Integer, default=0)
admin_level = Column(Integer, default=0)
coins_spent = Column(Integer, default=0)
lootboxes_bought = Column(Integer, default=0)
agendaposter = Column(Boolean, default=False)
agendaposter_expires_utc = Column(Integer, default=0)
changelogsub = Column(Boolean, default=False)

View File

@ -128,7 +128,6 @@ def buy(v, award):
g.db.add(v)
g.db.flush()
if award == "lootbox":
@ -140,12 +139,24 @@ def buy(v, award):
award = AwardRelationship(id=thing, user_id=v.id, kind=award)
g.db.add(award)
g.db.flush()
v.lootboxes_bought += 1
if v.lootboxes_bought == 10 and not v.has_badge(76):
new_badge = Badge(badge_id=76, user_id=v.id)
g.db.add(new_badge)
elif v.lootboxes_bought == 50 and not v.has_badge(77):
new_badge = Badge(badge_id=77, user_id=v.id)
g.db.add(new_badge)
elif v.lootboxes_bought == 150 and not v.has_badge(78):
new_badge = Badge(badge_id=78, user_id=v.id)
g.db.add(new_badge)
else:
thing = g.db.query(AwardRelationship).order_by(AwardRelationship.id.desc()).first().id
thing += 1
award = AwardRelationship(id=thing, user_id=v.id, kind=award)
g.db.add(award)
g.db.add(v)
g.db.commit()
return {"message": "Award bought!"}

View File

@ -75,7 +75,7 @@ def participation_stats(v):
@auth_required
def chart(v):
file = cached_chart()
return send_file(f".{file}")
return send_file(file)
@cache.memoize(timeout=86400)

View File

@ -44,7 +44,7 @@
<link rel="stylesheet" href="/assets/css/main-deprecated.css?v=190"><link rel="stylesheet" href="/assets/css/{{'DEFAULT_THEME' | app_config}}.css?v=190">
{% endif %}
<link href="/assets/css/fa.css?v=192" rel="stylesheet">
<link href="/assets/css/fa.css?v=193" rel="stylesheet">
</head>
<body id="settings2" style="overflow-x: hidden; {% if v and v.background %} background:url(/assets/images/backgrounds/{{v.background}}) no-repeat center center fixed !important; background-size: cover!important; background-color: #000!important;{% endif %}">