remotes/1693045480750635534/spooky-22
Aevann1 2021-11-15 01:59:25 +02:00
parent e138aab369
commit 7e851f38db
2 changed files with 7 additions and 8 deletions

View File

@ -8,7 +8,7 @@ services:
- "./:/service" - "./:/service"
environment: environment:
- DATABASE_URL=postgresql://postgres@postgres:5432 - DATABASE_URL=postgresql://postgres@postgres:5432
- MASTER_KEY=${MASTER_KEY:XuxGqp5NyygJrM24b5gt3YgyvFVGdQnwVDwLzLwpu3eQwY} - MASTER_KEY=XuxGqp5NyygJrM24b5gt3YgyvFVGdQnwVDwLzLwpu3eQwY
- REDIS_URL=redis://redis - REDIS_URL=redis://redis
- DOMAIN=127.0.0.1 - DOMAIN=127.0.0.1
- SITE_NAME=Drama - SITE_NAME=Drama

View File

@ -19,14 +19,13 @@ from files.helpers.discord import add_role
SITE_NAME = environ.get("SITE_NAME", "").strip() SITE_NAME = environ.get("SITE_NAME", "").strip()
@app.get("/votes2") @app.get("/upvoters/<id>")
@admin_level_required(6) @admin_level_required(6)
def votes2(v): def votes2(v, id):
votes = g.db.query(Votes).join(Submission, Vote.submission_id==Submission.id).filter(Submission.author_id==7)all() try: id = int(id)
li = [] except: abort(400)
for v in votes: votes = g.db.query(Vote.user_id, func.count(Vote.user_id)).join(Submission, Vote.submission_id==Submission.id).filter(Vote.vote_type==1, Submission.author_id==id).group_by(Vote.user_id).all()
li.append(v.user_id) return(str(votes))
return(str(li))