Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ecommerce
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
ecommerce
Commits
7fde2cff
Commit
7fde2cff
authored
Jul 11, 2016
by
Vedran Karacic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for create_invoice management command.
parent
f0474519
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
+3
-1
ecommerce/invoice/management/commands/create_invoices.py
+3
-1
No files found.
ecommerce/invoice/management/commands/create_invoices.py
View file @
7fde2cff
...
@@ -24,7 +24,9 @@ class Command(BaseCommand):
...
@@ -24,7 +24,9 @@ class Command(BaseCommand):
def
handle
(
self
,
*
args
,
**
options
):
def
handle
(
self
,
*
args
,
**
options
):
for
coupon
in
Product
.
objects
.
filter
(
product_class__name
=
'Coupon'
):
for
coupon
in
Product
.
objects
.
filter
(
product_class__name
=
'Coupon'
):
try
:
try
:
basket
=
Basket
.
objects
.
get
(
lines__product
=
coupon
,
status
=
Basket
.
SUBMITTED
)
basket
=
Basket
.
objects
.
filter
(
lines__product
=
coupon
,
status
=
Basket
.
SUBMITTED
)
.
first
()
if
basket
is
None
:
raise
Basket
.
DoesNotExist
order
=
Order
.
objects
.
get
(
basket
=
basket
)
order
=
Order
.
objects
.
get
(
basket
=
basket
)
Invoice
.
objects
.
get
(
order
=
order
)
Invoice
.
objects
.
get
(
order
=
order
)
logger
.
info
(
'Invoice for order
%
s already exists - skipping.'
,
order
.
number
)
logger
.
info
(
'Invoice for order
%
s already exists - skipping.'
,
order
.
number
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment