Skip to content

Commit

Permalink
fix 500 in sqlalchemy example (spec-first#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtkav authored and jmcs committed Apr 27, 2018
1 parent 6cad83c commit 5bc8a78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/sqlalchemy/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def get_pets(limit, animal_type=None):

def get_pet(pet_id):
pet = db_session.query(orm.Pet).filter(orm.Pet.id == pet_id).one_or_none()
return pet.dump() or ('Not found', 404)
return pet.dump() if pet is not None else ('Not found', 404)


def put_pet(pet_id, pet):
Expand Down

0 comments on commit 5bc8a78

Please sign in to comment.