X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/3a70fb37a8784ea703eb23d8b19b90bfd00f13bc..926c8a3e09932478189cc103f4e02787ae66cc61:/librarian/dcparser.py diff --git a/librarian/dcparser.py b/librarian/dcparser.py index f64317a..50811e7 100644 --- a/librarian/dcparser.py +++ b/librarian/dcparser.py @@ -152,7 +152,7 @@ class WorkInfo(object): __metaclass__ = DCInfo FIELDS = ( - Field( DCNS('creator'), 'authors', as_person, salias='author', multiple=True), + Field( DCNS('creator'), 'authors', as_person, salias='author', multiple=True, required=False), Field( DCNS('title'), 'title'), Field( DCNS('type'), 'type', required=False, multiple=True), @@ -248,7 +248,7 @@ class WorkInfo(object): if not field.multiple: raise "OUCH!! for field %s" % name - return value[0] + return value[0] if value else None except (KeyError, AttributeError): return object.__getattribute__(self, name)