Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/planet.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ def insert(self):
def get(id, name):
query = {}
if id is not None:
query.update({"_id": id})
query["_id"] = id
if name is not None:
query.update({"name": name})
query["name"] = name
try:
response = [planet for planet in planets.find(query)]
response = list(planets.find(query))
Comment on lines -56 to +60
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Planet.get refactored with the following changes:

return {"status": 200, "response": response}
except:
return {"status": 500, "response": "Internal server error"}
Expand Down