fix: Overriding avatar didn't update DNS record
All checks were successful
Build Docker / Build Main Image (push) Successful in 19s
Build Docker / Build SLDs Image (push) Successful in 20s

This commit is contained in:
Nathan Woodburn 2023-11-18 12:10:32 +11:00
parent 268721555c
commit 4a21cf9a5a
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
2 changed files with 2 additions and 6 deletions

View File

@ -26,7 +26,7 @@ def allowed_file(filename):
return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
def save_avatar(file,owner):
filename = re.sub(r'[^a-zA-Z0-9]', '', file.filename).lower()
filename = re.sub(r'[^a-zA-Z0-9.]', '', file.filename).lower()

View File

@ -125,7 +125,6 @@ def get_zone():
"content": ""
}
r = requests.post(url, headers=headers, json=data)
print(r.text)
r = r.json()
for record in r['data']:
TLSA = record['content']
@ -160,7 +159,6 @@ def update_avatar(avatar,domain):
print("Avatar already set", flush=True)
return "Avatar already set"
record_id = record['uuid']
if record_id == "":
data = {
"action": "addRecord",
@ -173,7 +171,7 @@ def update_avatar(avatar,domain):
data = {
"action": "updateRecord",
"zone": zone,
"record": record,
"record": record_id,
"column": "content",
"value": "profile avatar=" + avatar
}
@ -185,7 +183,6 @@ def update_avatar(avatar,domain):
"zone": zone,
"record": record_id
}
r = requests.post(url, headers=headers, json=data)
return r.text
@ -226,5 +223,4 @@ def verify_ALIAS(domain):
"content": TLSA,
}
r = requests.post(url, headers=headers, json=data)
print(r.text)
return r.text