-
Notifications
You must be signed in to change notification settings - Fork 286
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
send_receipt: handle email backend returning None #390
Conversation
Codecov Report
@@ Coverage Diff @@
## master #390 +/- ##
=======================================
Coverage 99.84% 99.84%
=======================================
Files 31 31
Lines 1302 1302
Branches 98 98
=======================================
Hits 1300 1300
Partials 2 2
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #390 +/- ##
=======================================
Coverage 99.84% 99.84%
=======================================
Files 31 31
Lines 1302 1302
Branches 98 98
=======================================
Hits 1300 1300
Partials 2 2
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #390 +/- ##
=======================================
Coverage 99.39% 99.39%
=======================================
Files 34 34
Lines 1662 1662
Branches 135 135
=======================================
Hits 1652 1652
Misses 5 5
Partials 5 5
Continue to review full report at Codecov.
|
@@ -51,7 +51,7 @@ def send_receipt(self, charge, email=None): | |||
to=[email], | |||
from_email=settings.PINAX_STRIPE_INVOICE_FROM_EMAIL | |||
).send() | |||
charge.receipt_sent = num_sent > 0 | |||
charge.receipt_sent = num_sent and num_sent > 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.
You could do that also bool(num_sent) > 0
.
reads better I think.
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.
Not motivated enough to change that now.
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.
fair enough
ready from my PIV: there could be a test, but not from me. |
TODO: