endorsement/achievements.py
2018-07-12 21:37:37 +02:00

11 lines
No EOL
270 B
Python

from app import app
from models import Achievement
import json
@app.route("/achievement/<id>")
def get_achievement(id):
achievement = Achievement.query.filter_by(id=id).first()
if not achievement:
return "{}"
return json.dumps(achievement.to_obj())