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

Add way to access orders and items for a user #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Flova
Copy link
Member

@Flova Flova commented Jun 28, 2020

No description provided.

@Flova Flova requested review from jaagut and timonegk June 28, 2020 14:12
@Flova
Copy link
Member Author

Flova commented Jun 29, 2020

And fix tip

@jaagut jaagut removed their request for review June 29, 2020 21:09
@@ -62,6 +74,7 @@ def patch(self, order_id, item_id):
if item.order.deadline < datetime.utcnow():
abort(422, message="The order is expired, so no items can be modified")
item.update(args)
if item.tip_absolute and item.tip_percent:
abort(422, message="The tip can only be provided in percent OR a absolute value. Take care that not both are set in the db.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
abort(422, message="The tip can only be provided in percent OR a absolute value. Take care that not both are set in the db.")
abort(422, message="The tip can only be provided in percent OR absolute value. Take care that only one is set.")

apos/resources/items.py Outdated Show resolved Hide resolved
@@ -75,6 +75,7 @@ def serialize(self):
item = {
'id': self.id,
'order_id': self.order.id,
'order': self.order.serialize,
Copy link
Contributor

Choose a reason for hiding this comment

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

I am against serializing the order here. We should discuss that.

Co-authored-by: Timon Engelke <timonegk@users.noreply.github.com>
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