mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-10-26 07:46:35 +01:00
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:
@@ -1118,14 +1118,11 @@ class DNSManager:
|
||||
new_r_proxied_flag = True
|
||||
|
||||
for dns_record in dns_records:
|
||||
r_zone_id = dns_record['zone_id']
|
||||
r_id = dns_record['id']
|
||||
r_name = dns_record['name']
|
||||
r_type = dns_record['type']
|
||||
r_content = dns_record['content']
|
||||
r_ttl = dns_record['ttl']
|
||||
r_proxied = dns_record['proxied']
|
||||
r_proxiable = dns_record['proxiable']
|
||||
|
||||
if r_proxied == new_r_proxied_flag:
|
||||
# Nothing to do
|
||||
@@ -1134,8 +1131,6 @@ class DNSManager:
|
||||
dns_record_id = dns_record['id']
|
||||
|
||||
new_dns_record = {
|
||||
'zone_id': r_zone_id,
|
||||
'id': r_id,
|
||||
'type': r_type,
|
||||
'name': r_name,
|
||||
'content': r_content,
|
||||
|
||||
Reference in New Issue
Block a user