do not write description line if there are only NotAvailable attributes
This commit is contained in:
parent
2d247086a1
commit
3fcc3333a0
1 changed files with 3 additions and 0 deletions
|
|
@ -39,6 +39,9 @@ class VideoListFormatter(PrettyFormatter):
|
||||||
return obj.title
|
return obj.title
|
||||||
|
|
||||||
def get_description(self, obj):
|
def get_description(self, obj):
|
||||||
|
if empty(obj.duration) and empty(obj.date):
|
||||||
|
return None
|
||||||
|
|
||||||
result = '%s' % (obj.duration or obj.date)
|
result = '%s' % (obj.duration or obj.date)
|
||||||
if hasattr(obj, 'author') and not empty(obj.author):
|
if hasattr(obj, 'author') and not empty(obj.author):
|
||||||
result += u' - %s' % obj.author
|
result += u' - %s' % obj.author
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue