From 4a7a39928c0a4e35402638dbaeb4e67f4e9417b6 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 14 Dec 2021 23:56:43 +0200 Subject: [PATCH 1/4] sdffds --- files/templates/default.html | 2 +- files/templates/login.html | 2 +- files/templates/settings.html | 2 +- files/templates/settings2.html | 2 +- files/templates/submit.html | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/files/templates/default.html b/files/templates/default.html index 052f39a94..5a3176c29 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -14,7 +14,7 @@ {% endif %} - + diff --git a/files/templates/login.html b/files/templates/login.html index 60be4c895..2d3bf1339 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -19,7 +19,7 @@ - + diff --git a/files/templates/settings.html b/files/templates/settings.html index 38f5b54c0..80352427c 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -36,7 +36,7 @@ {% if v.agendaposter %}{% elif v.css %}{% endif %} - + diff --git a/files/templates/settings2.html b/files/templates/settings2.html index c5ce75dff..cc7f23dcb 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -44,7 +44,7 @@ {% endif %} - + diff --git a/files/templates/submit.html b/files/templates/submit.html index c7643231b..7cc684525 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -34,7 +34,7 @@ {% endif %} {% endblock %} - + From 252c9303d8aca7f75593705b251105970c96b9bc Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 15 Dec 2021 00:06:54 +0200 Subject: [PATCH 2/4] sfdfds --- files/classes/user.py | 1 + files/routes/awards.py | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index b5cca7bb9..bc27aaee4 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -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) diff --git a/files/routes/awards.py b/files/routes/awards.py index ad6d6493c..ca3953487 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -128,11 +128,9 @@ def buy(v, award): - g.db.add(v) g.db.flush() if award == "lootbox": - send_notification(995, f"@{v.username} bought a lootbox!") for i in [1,2,3,4,5]: thing = g.db.query(AwardRelationship).order_by(AwardRelationship.id.desc()).first().id thing += 1 @@ -140,12 +138,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!"} From 3e3278ba8b22703f531917ff0c52215d0ca7b955 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 15 Dec 2021 00:08:48 +0200 Subject: [PATCH 3/4] fdsfds --- files/routes/awards.py | 1 + 1 file changed, 1 insertion(+) diff --git a/files/routes/awards.py b/files/routes/awards.py index ca3953487..4f6eb29fa 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -131,6 +131,7 @@ def buy(v, award): g.db.flush() if award == "lootbox": + send_notification(995, f"@{v.username} bought a lootbox!") for i in [1,2,3,4,5]: thing = g.db.query(AwardRelationship).order_by(AwardRelationship.id.desc()).first().id thing += 1 From 5f3bc5d8a732d9c62191e1984a616415b17c645d Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 15 Dec 2021 00:10:11 +0200 Subject: [PATCH 4/4] fdsfsd --- files/routes/static.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/static.py b/files/routes/static.py index 754b3f833..52d0facad 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -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)