sfdfsd
This commit is contained in:
parent
56c0fe2f9e
commit
8c13a0c879
2 changed files with 17 additions and 1 deletions
|
@ -21,6 +21,22 @@ SITE_NAME = environ.get("SITE_NAME", "").strip()
|
|||
if SITE_NAME == 'PCM': cc = "splash mountain"
|
||||
else: cc = "country club"
|
||||
|
||||
@app.get("/distribute/<cid>")
|
||||
@admin_level_required(2)
|
||||
def distribute(v, cid):
|
||||
votes = g.db.query(CommentVote).filter_by(comment_id=cid)
|
||||
autobetter = g.db.query(User).filter_by(id=AUTOBETTER_ID).first()
|
||||
coinsperperson = int(autobetter.coins / votes.count())
|
||||
for vote in votes:
|
||||
u = vote.user
|
||||
u.coins += coinsperperson
|
||||
g.db.add(u)
|
||||
|
||||
autobetter.coins = 0
|
||||
g.db.add(autobetter)
|
||||
g.db.commit()
|
||||
return str(coinsperperson)
|
||||
|
||||
@app.get("/marseys")
|
||||
@auth_desired
|
||||
def marseys(v):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue