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")
|
||||
if not name:
|
||||
return "No name supplied"
|
||||
a = Achievement(name=name, achieved_by=current_user.id)
|
||||
db.session.add(a)
|
||||
achievement = Achievement(name=name, achieved_by=id)
|
||||
achievement.endorsed_by.append(current_user)
|
||||
db.session.add(achievement)
|
||||
db.session.commit()
|
||||
return "OK"
|
||||
|
||||
|
||||
@app.route("/users/<id>")
|
||||
def get_user(id):
|
||||
user = User.query.filter_by(id=id).first()
|
||||
|
|
Loading…
Reference in a new issue