fix: Reusing the same variable

This commit is contained in:
Nathan Woodburn 2024-02-25 13:29:32 +11:00
parent 463125bac7
commit 2244c0fd1a
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

10
main.py
View File

@ -190,13 +190,13 @@ def site_post():
address.append({'token': 'sol', 'address': request.form['sol']})
# Remove empty socials and addresses
socials = [i for i in socials if i['url'] != '']
socials = [social for socials in socials if social['url'] != '']
# Make sure links all start with http or https
for i in socials:
for social in socials:
# Set link to lowercase
i['url'] = i['url'].lower()
if not i['url'].startswith('http') and i['name'] != 'email':
i['url'] = 'https://' + i['url']
social['url'] = social['url'].lower()
if not social['url'].startswith('http') and social['name'] != 'email':
social['url'] = 'https://' + social['url']
data['socials'] = socials