Skip to content
Snippets Groups Projects
Commit bb9dfa6c authored by Alessandro Cerioni's avatar Alessandro Cerioni
Browse files

Splitting organisation and individual name for Dublin Core metadata

parent 74dbf6bf
Branches pg+auth
Tags
No related merge requests found
......@@ -89,13 +89,20 @@ def list_to_dictlist( the_input, the_context=None ):
if the_context == 'responsibleParty':
try:
# the following applies to legacy metadata
parent_organisation, child_organisation = out_item['organisationName'].split('/')
parent_organisation = parent_organisation.strip()
child_organisation = child_organisation.strip()
except:
parent_organisation, child_organisation = out_item['organisationName'], None
parent_organisation = parent_organisation.strip()
child_organisation = None
try:
# the following applies to Dublin Core metadata
my_re = re.compile(r"(?P<organisationName>[^\(\)]+)(\((?P<individualName>.*)\))")
parent_organisation = my_re.match(out_item['organisationName']).groupdict()['organisationName'].strip()
child_organisation = my_re.match(out_item['organisationName']).groupdict()['individualName'].strip()
except:
parent_organisation, child_organisation = out_item['organisationName'], None
parent_organisation = parent_organisation.strip()
child_organisation = None
out_item['organisationName'] = parent_organisation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment