-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix: Admin Sales API #7322
fix: Admin Sales API #7322
Conversation
app/api/admin_sales/utils.py
Outdated
""" | ||
Groups orders by status and returns the total sales and ticket count as a | ||
dictionary | ||
""" | ||
sales = Order.query.filter_by(event_id=event.id, status=status).with_entities(func.sum(Order.amount)).scalar() or 0 | ||
tickets = get_count(TicketHolder.query.join(Order).filter(Order.event_id == event.id, Order.status == status)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (114 > 90 characters)
app/api/admin_sales/utils.py
Outdated
""" | ||
Groups orders by status and returns the total sales and ticket count as a | ||
dictionary | ||
""" | ||
sales = Order.query.filter_by(event_id=event.id, status=status).with_entities(func.sum(Order.amount)).scalar() or 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Black would make changes.
line too long (119 > 90 characters)
return { | ||
'sales_total': sum(o.amount for o in orders if o.status == status), | ||
'ticket_count': sum(o.tickets_count for o in orders if o.status == status), | ||
'sales_total': sales, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Black would make changes.
Codecov Report
@@ Coverage Diff @@
## development #7322 +/- ##
============================================
Coverage 64.12% 64.13%
============================================
Files 259 259
Lines 13086 13095 +9
============================================
+ Hits 8392 8399 +7
- Misses 4694 4696 +2
Continue to review full report at Codecov.
|
This pull request introduces 1 alert when merging cf65c09 into 3d562fa - view on LGTM.com new alerts:
|
For fossasia/open-event-frontend#5163