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
|
return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
|
||||||
|
|
||||||
def save_avatar(file,owner):
|
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": ""
|
"content": ""
|
||||||
}
|
}
|
||||||
r = requests.post(url, headers=headers, json=data)
|
r = requests.post(url, headers=headers, json=data)
|
||||||
print(r.text)
|
|
||||||
r = r.json()
|
r = r.json()
|
||||||
for record in r['data']:
|
for record in r['data']:
|
||||||
TLSA = record['content']
|
TLSA = record['content']
|
||||||
@ -160,7 +159,6 @@ def update_avatar(avatar,domain):
|
|||||||
print("Avatar already set", flush=True)
|
print("Avatar already set", flush=True)
|
||||||
return "Avatar already set"
|
return "Avatar already set"
|
||||||
record_id = record['uuid']
|
record_id = record['uuid']
|
||||||
|
|
||||||
if record_id == "":
|
if record_id == "":
|
||||||
data = {
|
data = {
|
||||||
"action": "addRecord",
|
"action": "addRecord",
|
||||||
@ -173,7 +171,7 @@ def update_avatar(avatar,domain):
|
|||||||
data = {
|
data = {
|
||||||
"action": "updateRecord",
|
"action": "updateRecord",
|
||||||
"zone": zone,
|
"zone": zone,
|
||||||
"record": record,
|
"record": record_id,
|
||||||
"column": "content",
|
"column": "content",
|
||||||
"value": "profile avatar=" + avatar
|
"value": "profile avatar=" + avatar
|
||||||
}
|
}
|
||||||
@ -185,7 +183,6 @@ def update_avatar(avatar,domain):
|
|||||||
"zone": zone,
|
"zone": zone,
|
||||||
"record": record_id
|
"record": record_id
|
||||||
}
|
}
|
||||||
|
|
||||||
r = requests.post(url, headers=headers, json=data)
|
r = requests.post(url, headers=headers, json=data)
|
||||||
return r.text
|
return r.text
|
||||||
|
|
||||||
@ -226,5 +223,4 @@ def verify_ALIAS(domain):
|
|||||||
"content": TLSA,
|
"content": TLSA,
|
||||||
}
|
}
|
||||||
r = requests.post(url, headers=headers, json=data)
|
r = requests.post(url, headers=headers, json=data)
|
||||||
print(r.text)
|
|
||||||
return r.text
|
return r.text
|
Loading…
Reference in New Issue
Block a user