Skip to content
Snippets Groups Projects
Commit 3bb5614b authored by Herman Andersen Dyrkorn's avatar Herman Andersen Dyrkorn
Browse files

move query up

parent 21b09c41
No related branches found
No related tags found
1 merge request!37Resolve "rematch function and endpoint"
......@@ -75,14 +75,12 @@ class SalamanderClass(Resource):
if user.admin and "id" in data and "image_id" in data:
salamander = db.session.query(Salamander).filter_by(id=data['id']).first()
if salamander:
if "weight" in data:
growth_row = db.session.query(SalamanderGrowth).filter_by(
salamander_id=salamander.id, image_id=int(data['image_id'])).first()
if "weight" in data:
growth_row.weight = sanitize_number_str(str(data['weight']))
db.session.commit()
if "length" in data:
growth_row = db.session.query(SalamanderGrowth).filter_by(
salamander_id=salamander.id, image_id=int(data['image_id'])).first()
growth_row.length = sanitize_number_str(str(data['length']))
db.session.commit()
if "location" in data and "new_location" in data and "new_sex" in data and "new_species" in data:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment