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

feat: New Create Order API #7047

Merged
merged 4 commits into from
Jun 5, 2020

Conversation

iamareebjamal
Copy link
Member

@iamareebjamal iamareebjamal commented Jun 4, 2020

Fixes #6569
Fix for #6302

user = UserFactory()
db.session.commit()

return {'Authorization': "JWT " + create_access_token(user.id, fresh=True)}

Choose a reason for hiding this comment

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

Black would make changes.

from flask_jwt_extended.utils import create_access_token
from app.models.ticket_holder import TicketHolder
from tests.factories.event import EventFactoryBasic
from tests.factories.order import OrderFactory, OrderSubFactory

Choose a reason for hiding this comment

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

'tests.factories.order.OrderFactory' imported but unused

db.session.refresh(order)
order_schema = OrderSchema()
return order_schema.dump(order)
event = tickets[0].event

Choose a reason for hiding this comment

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

local variable 'event' is assigned to but never used

@@ -1,3 +1,4 @@
import json

Choose a reason for hiding this comment

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

'json' imported but unused

@codecov
Copy link

codecov bot commented Jun 4, 2020

Codecov Report

Merging #7047 into development will increase coverage by 0.56%.
The diff coverage is 77.38%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #7047      +/-   ##
===============================================
+ Coverage        60.60%   61.16%   +0.56%     
===============================================
  Files              260      260              
  Lines            12886    12882       -4     
===============================================
+ Hits              7809     7879      +70     
+ Misses            5077     5003      -74     
Impacted Files Coverage Δ
app/api/attendees.py 41.52% <0.00%> (+0.34%) ⬆️
app/templates/flask_ext/jinja/filters.py 77.77% <ø> (ø)
app/api/orders.py 33.07% <60.97%> (+6.20%) ⬆️
app/api/custom/orders.py 37.35% <92.85%> (+17.76%) ⬆️
app/api/helpers/order.py 66.93% <100.00%> (+0.80%) ⬆️
app/models/order.py 89.47% <100.00%> (+0.43%) ⬆️
app/models/ticket.py 78.26% <100.00%> (+3.26%) ⬆️
app/api/schema/orders.py 93.75% <0.00%> (+4.68%) ⬆️
app/api/schema/__init__.py 83.33% <0.00%> (+33.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3ccc441...4e6d66c. Read the comment docs.

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 4, 2020

This pull request introduces 5 alerts when merging db012a4 into 3ccc441 - view on LGTM.com

new alerts:

  • 4 for Unused import
  • 1 for Unused local variable

from datetime import datetime

import pytz
from flask import Blueprint, jsonify, make_response, request
from flask import Blueprint, app, jsonify, make_response, request

Choose a reason for hiding this comment

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

'flask.app' imported but unused

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 4, 2020

This pull request introduces 5 alerts when merging b57ac77 into 3ccc441 - view on LGTM.com

new alerts:

  • 5 for Unused import

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 5, 2020

This pull request introduces 3 alerts when merging 85010f3 into 24fd032 - view on LGTM.com

new alerts:

  • 3 for Unused import

@iamareebjamal iamareebjamal changed the title wip: New Order create API feat: New Create Order API Jun 5, 2020
@auto-label auto-label bot added the feature label Jun 5, 2020
@niranjan94
Copy link
Member

Codacy Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- tests/all/integration/api/helpers/order/test_create_order.py  7
         

Clones added
============
- tests/all/integration/api/helpers/order/test_create_order.py  2
         

Clones removed
==============
+ app/api/orders.py  -2
         

See the complete overview on Codacy

@iamareebjamal iamareebjamal merged commit 98aca7d into fossasia:development Jun 5, 2020
@iamareebjamal iamareebjamal deleted the order-create branch June 5, 2020 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discount Code Orders possible even though number of discounted tickets exhausted
3 participants