Add comma parsing to xml generator
@@ -4198,7 +4198,24 @@ class CoreMetaData(models.Model):
if person.name:
hsterms_name = etree.SubElement(dc_person_rdf_Description,
'{%s}name' % self.NAMESPACES['hsterms'])
+
+ if "," in person.name:
+ name_parts = person.name.split(",")
+ first_names = None
+ last_names = None
+ if len(name_parts) == 1:
+ last_names = name_parts[0]
+ elif len(name_parts) == 2:
+ first_names = name_parts[1]
+ last_names = name_parts[0]
+
+ if first_names:
+ hsterms_name.text = first_names + " " + last_names
+ else:
+ hsterms_name.text = last_names
+ else:
hsterms_name.text = person.name
+
if person.description:
dc_person_rdf_Description.set('{%s}about' % self.NAMESPACES['rdf'],
current_site_url() + person.description)
