Also check the username the user has in his export file, will be used for the mass-import of libravatar data

This commit is contained in:
Oliver Falk
2018-11-23 11:33:47 +01:00
parent c1d6a751da
commit 755143ea79

View File

@@ -20,6 +20,7 @@ def read_gzdata(gzdata=None):
emails = [] # pylint: disable=invalid-name
openids = [] # pylint: disable=invalid-name
photos = [] # pylint: disable=invalid-name
username = None # pylint: disable=invalid-name
if not gzdata:
return False
@@ -32,6 +33,11 @@ def read_gzdata(gzdata=None):
print('Unknown export format: %s' % root.tag)
exit(-1)
# Username
for item in root.findall('{%s}account' % SCHEMAROOT)[0].items():
if item[0] == 'username':
username = item[1]
# Emails
for email in root.findall('{%s}emails' % SCHEMAROOT)[0]:
if email.tag == '{%s}email' % SCHEMAROOT:
@@ -69,4 +75,5 @@ def read_gzdata(gzdata=None):
'emails': emails,
'openids': openids,
'photos': photos,
'username': username,
}