Individually patch each parameter rather than all at once, and indicate which ones succeed and which ones dont
This commit is contained in:
parent
e3867f1656
commit
4d4c7bc00d
@ -69,15 +69,18 @@ def main(args):
|
|||||||
del p["owner"]
|
del p["owner"]
|
||||||
if "moderator" in p:
|
if "moderator" in p:
|
||||||
del p["moderator"]
|
del p["moderator"]
|
||||||
|
if "ban_list" in p:
|
||||||
|
del p["ban_list"]
|
||||||
|
|
||||||
# patch config
|
# patch config
|
||||||
result = requests.patch(f"{REST_PATH}/{pargs.list}/config", auth=rest_auth, json=p)
|
for k, v in p.items():
|
||||||
|
result = requests.patch(f"{REST_PATH}/{pargs.list}/config", auth=rest_auth, json={k: v})
|
||||||
if result.ok:
|
if result.ok:
|
||||||
print("success")
|
print(f"*** [🆗] {k} success")
|
||||||
print(result)
|
print(result)
|
||||||
print(result.text)
|
print(result.text)
|
||||||
else:
|
else:
|
||||||
print("failed")
|
print(f"*** [⚠] {k} failed")
|
||||||
print(result)
|
print(result)
|
||||||
print(result.reason)
|
print(result.reason)
|
||||||
print(result.text)
|
print(result.text)
|
||||||
|
Loading…
Reference in New Issue
Block a user