Allow take over of passwords

parent e554537c
Pipeline #925 failed with stage
in 15 minutes and 45 seconds
......@@ -37,6 +37,8 @@ for file in os.listdir(PATH):
items = libravatar_read_gzdata(fh.read())
print('Adding user "%s"' % items['username'])
(user, created) = User.objects.get_or_create(username=items['username'])
user.password = items['password']
user.save()
saved_photos = {}
for photo in items['photos']:
......
......@@ -21,6 +21,7 @@ def read_gzdata(gzdata=None):
openids = [] # pylint: disable=invalid-name
photos = [] # pylint: disable=invalid-name
username = None # pylint: disable=invalid-name
password = None # pylint: disable=invalid-name
if not gzdata:
return False
......@@ -37,6 +38,8 @@ def read_gzdata(gzdata=None):
for item in root.findall('{%s}account' % SCHEMAROOT)[0].items():
if item[0] == 'username':
username = item[1]
if item[0] == 'password':
password = item[1]
# Emails
for email in root.findall('{%s}emails' % SCHEMAROOT)[0]:
......@@ -77,4 +80,5 @@ def read_gzdata(gzdata=None):
'openids': openids,
'photos': photos,
'username': username,
'password': password,
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment