check for ebook

pull/1/head
eric 2015-09-03 13:35:40 -04:00
parent 6b16bf683d
commit b360bfea6b
1 changed files with 2 additions and 1 deletions

View File

@ -74,7 +74,8 @@ def product(edition, facet=None):
descriptive_node.append(text_node("ProductFormDetail", "E107" ))
elif ebook.format=='mobi':
descriptive_node.append(text_node("ProductFormDetail", "E116" ))
if ebook.rights:
if ebook and ebook.rights:
license_node = etree.SubElement(descriptive_node, "EpubLicense")
license_node.append(text_node("EpubLicenseName", ebook.rights ))
lic_expr_node = etree.SubElement(license_node, "EpubLicenseExpression")