Fixed slight mistake in adding achievements
This commit is contained in:
parent
31483fdd2e
commit
4d452d47ea
1 changed files with 3 additions and 3 deletions
6
user.py
6
user.py
|
@ -12,12 +12,12 @@ def add_achievement(id):
|
||||||
name = request.args.get("name")
|
name = request.args.get("name")
|
||||||
if not name:
|
if not name:
|
||||||
return "No name supplied"
|
return "No name supplied"
|
||||||
a = Achievement(name=name, achieved_by=current_user.id)
|
achievement = Achievement(name=name, achieved_by=id)
|
||||||
db.session.add(a)
|
achievement.endorsed_by.append(current_user)
|
||||||
|
db.session.add(achievement)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
return "OK"
|
return "OK"
|
||||||
|
|
||||||
|
|
||||||
@app.route("/users/<id>")
|
@app.route("/users/<id>")
|
||||||
def get_user(id):
|
def get_user(id):
|
||||||
user = User.query.filter_by(id=id).first()
|
user = User.query.filter_by(id=id).first()
|
||||||
|
|
Loading…
Reference in a new issue