Fix Cloudflare proxy enable/disable functionality

- Remove zone_id and id fields from DNS record update payload as they are not expected by Cloudflare API
- Fix KeyError 'zone_id' when accessing DNS record properties that don't exist
- Cloudflare API expects only the data fields in PUT request body, not the identifiers

Fixes #1478
This commit is contained in:
usmannasir
2025-08-13 01:29:21 +05:00
parent a4791035d0
commit b4ee0f173c

View File

@@ -1118,14 +1118,11 @@ class DNSManager:
new_r_proxied_flag = True new_r_proxied_flag = True
for dns_record in dns_records: for dns_record in dns_records:
r_zone_id = dns_record['zone_id']
r_id = dns_record['id']
r_name = dns_record['name'] r_name = dns_record['name']
r_type = dns_record['type'] r_type = dns_record['type']
r_content = dns_record['content'] r_content = dns_record['content']
r_ttl = dns_record['ttl'] r_ttl = dns_record['ttl']
r_proxied = dns_record['proxied'] r_proxied = dns_record['proxied']
r_proxiable = dns_record['proxiable']
if r_proxied == new_r_proxied_flag: if r_proxied == new_r_proxied_flag:
# Nothing to do # Nothing to do
@@ -1134,8 +1131,6 @@ class DNSManager:
dns_record_id = dns_record['id'] dns_record_id = dns_record['id']
new_dns_record = { new_dns_record = {
'zone_id': r_zone_id,
'id': r_id,
'type': r_type, 'type': r_type,
'name': r_name, 'name': r_name,
'content': r_content, 'content': r_content,