Skip to content

Cedar - Makhabat & Leticia #9

Open
makhabatmaksatbekova wants to merge 11 commits intoAda-C16:mainfrom
makhabatmaksatbekova:main
Open

Cedar - Makhabat & Leticia #9
makhabatmaksatbekova wants to merge 11 commits intoAda-C16:mainfrom
makhabatmaksatbekova:main

Conversation

@makhabatmaksatbekova
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@beccaelenzil beccaelenzil left a comment

Choose a reason for hiding this comment

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

🎉 Nice work!

Comment thread app/routes.py Outdated
self.description = description
self.color = color

def return_planets(self):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great use of an instance method!

Comment thread app/routes.py Outdated
Comment on lines +16 to +28
}


planets = [
Planet(1,"Mercury", "hot", "brown"),
Planet(2, "Venus", "pretty", "redish brown"),
Planet(3, "Earth", "wet", "greenis blue"),
Planet(6, "Saturn", "rings", "purple and yellow" )

]


solar_systems_bp = Blueprint("planets", __name__, url_prefix="/planets")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Minor note: for readability, consider removing extra line spaces.

Suggested change
}
planets = [
Planet(1,"Mercury", "hot", "brown"),
Planet(2, "Venus", "pretty", "redish brown"),
Planet(3, "Earth", "wet", "greenis blue"),
Planet(6, "Saturn", "rings", "purple and yellow" )
]
solar_systems_bp = Blueprint("planets", __name__, url_prefix="/planets")
}
planets = [
Planet(1,"Mercury", "hot", "brown"),
Planet(2, "Venus", "pretty", "redish brown"),
Planet(3, "Earth", "wet", "greenis blue"),
Planet(6, "Saturn", "rings", "purple and yellow" )
]
solar_systems_bp = Blueprint("planets", __name__, url_prefix="/planets")

Comment thread app/routes.py Outdated
Comment on lines +48 to +51
return {
"error": (f"ID {planet_id} not exists"),
"status": "404"
},404
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great work handling not found planets! Since the response code will be returned as 404, it is not necessary to include this in the json

Copy link
Copy Markdown

@kaidamasaki kaidamasaki left a comment

Choose a reason for hiding this comment

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

Great job!

I had one little note on naming but other than that everything looked good. Well done!

Comment thread app/routes.py
Comment on lines +9 to +13
def valid_int(number,parameter_type):
try:
int(number)
except:
abort(make_response({"error": f"{parameter_type} must be an integer"},400))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Style: I'd suggest some slightly different naming to make this clearer to someone using this function:

Suggested change
def valid_int(number,parameter_type):
try:
int(number)
except:
abort(make_response({"error": f"{parameter_type} must be an integer"},400))
def check_valid_int(number, parameter_name):
try:
int(number)
except:
abort(make_response({"error": f"{parameter_name} must be an integer"},400))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants