mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 11:23:42 +02:00
Don't put '' values into __unicode__ and to_html
This commit is contained in:
parent
f782ef0cb6
commit
4b92c7d68b
1 changed files with 4 additions and 3 deletions
|
|
@ -509,8 +509,9 @@ def fmt(x, y):
|
|||
fmt('Rights', unicode(self.rights))
|
||||
for key in self.user_metadata_keys():
|
||||
val = self.get(key, None)
|
||||
(name, val) = self.format_field(key)
|
||||
fmt(name, unicode(val))
|
||||
if val:
|
||||
(name, val) = self.format_field(key)
|
||||
fmt(name, unicode(val))
|
||||
return u'\n'.join(ans)
|
||||
|
||||
def to_html(self):
|
||||
|
|
@ -533,7 +534,7 @@ def to_html(self):
|
|||
ans += [(_('Rights'), unicode(self.rights))]
|
||||
for key in self.user_metadata_keys():
|
||||
val = self.get(key, None)
|
||||
if val is not None:
|
||||
if val:
|
||||
(name, val) = self.format_field(key)
|
||||
ans += [(name, val)]
|
||||
for i, x in enumerate(ans):
|
||||
|
|
|
|||
Loading…
Reference in a new issue