Cedar - Makhabat & Leticia #9
Open
makhabatmaksatbekova wants to merge 11 commits intoAda-C16:mainfrom
Open
Conversation
| self.description = description | ||
| self.color = color | ||
|
|
||
| def return_planets(self): |
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") |
There was a problem hiding this comment.
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 on lines
+48
to
+51
| return { | ||
| "error": (f"ID {planet_id} not exists"), | ||
| "status": "404" | ||
| },404 |
There was a problem hiding this comment.
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
kaidamasaki
reviewed
Oct 29, 2021
kaidamasaki
left a comment
There was a problem hiding this comment.
Great job!
I had one little note on naming but other than that everything looked good. Well done!
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)) |
There was a problem hiding this comment.
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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.