mirror of
https://git.linux-kernel.at/oliver/ivatar.git
synced 2025-11-18 22:18:02 +00:00
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:
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user