fix: Overriding avatar didn't update DNS record
This commit is contained in:
parent
268721555c
commit
4a21cf9a5a
@ -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()
|
||||
|
||||
|
||||
|
||||
|
6
varo.py
6
varo.py
@ -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
|
Loading…
Reference in New Issue
Block a user