master
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"
environment:
- DATABASE_URL=postgresql://postgres@postgres:5432
- MASTER_KEY=${MASTER_KEY:XuxGqp5NyygJrM24b5gt3YgyvFVGdQnwVDwLzLwpu3eQwY}
- MASTER_KEY=XuxGqp5NyygJrM24b5gt3YgyvFVGdQnwVDwLzLwpu3eQwY
- REDIS_URL=redis://redis
- DOMAIN=127.0.0.1
- SITE_NAME=Drama

View File

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