Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added error propagation #13

Merged
merged 3 commits into from
May 5, 2018
Merged

Conversation

CristianoYL
Copy link
Contributor

Added error propagation configuration to section5 and section6 code.

Slight improvement on code format:

  • Removed used import
  • Added proper indention and blank lines

@CristianoYL
Copy link
Contributor Author

Also, there's some missing logic in Item.put() and Item.delete(). I fixed it along the way.

@@ -52,12 +53,13 @@ def put(self, name):
if item:
item.price = data['price']
else:
item = ItemModel(name, data['price'])
item = ItemModel(name, **data)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We will create a new item in the else statement, and since the store_id is a required field in the reqparser, I suppose it should be provided to ItemModel.

Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense, can you change the post() method too so it's the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's updated now.

@jslvtr jslvtr merged commit 89070f7 into master May 5, 2018
@jslvtr jslvtr deleted the add_error_propagation_to_section_5_and_6 branch May 5, 2018 13:06
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.

2 participants