Commit ea29bb42 by Will Daly

Merge pull request #6961 from edx/will/quiet-error-logs-invoice-pdf-missing-image

Avoid logging errors when the image path is not provided for invoice PDFs
parents a2df7af5 51735253
...@@ -193,6 +193,7 @@ class PDFInvoice(object): ...@@ -193,6 +193,7 @@ class PDFInvoice(object):
) )
# Left-Aligned cobrand logo # Left-Aligned cobrand logo
if self.cobrand_logo_path:
cobrand_img = self.load_image(self.cobrand_logo_path) cobrand_img = self.load_image(self.cobrand_logo_path)
if cobrand_img: if cobrand_img:
img_width = float(cobrand_img.size[0]) / (float(cobrand_img.size[1]) / self.cobrand_logo_height) img_width = float(cobrand_img.size[0]) / (float(cobrand_img.size[1]) / self.cobrand_logo_height)
...@@ -200,6 +201,7 @@ class PDFInvoice(object): ...@@ -200,6 +201,7 @@ class PDFInvoice(object):
self.cobrand_logo_height, mask='auto') self.cobrand_logo_height, mask='auto')
# Right aligned brand logo # Right aligned brand logo
if self.logo_path:
logo_img = self.load_image(self.logo_path) logo_img = self.load_image(self.logo_path)
if logo_img: if logo_img:
img_width = float(logo_img.size[0]) / (float(logo_img.size[1]) / self.brand_logo_height) img_width = float(logo_img.size[0]) / (float(logo_img.size[1]) / self.brand_logo_height)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment