This commit is contained in:
Oliver Falk
2018-11-23 13:17:30 +01:00
3 changed files with 11 additions and 3 deletions

View File

@@ -448,8 +448,8 @@ class ConfirmedOpenId(BaseAccountModel):
lowercase_url = urlunsplit(
(url.scheme.lower(), netloc, url.path, url.query, url.fragment)
)
if lowercase_url[-1] != '/':
lowercase_url += '/'
#if lowercase_url[-1] != '/':
# lowercase_url += '/'
self.openid = lowercase_url
self.digest = hashlib.sha256(lowercase_url.encode('utf-8')).hexdigest()
return super().save(force_insert, force_update, using, update_fields)

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,
}

View File

@@ -55,6 +55,7 @@ class AvatarImageView(TemplateView):
if sizetemp:
if sizetemp != '' and sizetemp is not None and sizetemp != '0':
try:
if int(sizetemp) > 0:
size = int(sizetemp)
# Should we receive something we cannot convert to int, leave
# the user with the default value of 80