Skip to content

Commit 01f50df

Browse files
committed
fixup! better none support
1 parent c21d6b3 commit 01f50df

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

nextdns_sync.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -152,22 +152,22 @@ def sync_profiles(keys_to_sync: List[str], payload: Optional[Dict] = None) -> No
152152
logger.debug("[SYNC] Generated Payload: %s", json.dumps(payload, separators=(',', ':')))
153153

154154
for profile_id in PROFILE_SYNC_LIST:
155-
if profile_id is not None:
156-
for key in keys_to_sync:
157-
if key in payload:
158-
key_payload = payload[key]
159-
logger.info("[SYNC] Using Key [%s]", key)
160-
if "blocklists" in key_payload:
161-
logger.debug("[SYNC] [blocklists] to be filtered")
162-
key_payload["blocklists"] = filter_blocklists(key_payload["blocklists"])
163-
try:
164-
if isinstance(key_payload, list):
165-
update_array_settings(profile_id, key, key_payload)
166-
else:
167-
update_profile_settings(profile_id, key_payload, key)
168-
logger.info("[SYNC] Successfully updated %s for profile %s.", key, profile_id)
169-
except Exception as e:
170-
logger.error("[SYNC] Failed to update %s for profile %s: %s", key, profile_id, e)
155+
if profile_id is not None:
156+
for key in keys_to_sync:
157+
if key in payload:
158+
key_payload = payload[key]
159+
logger.info("[SYNC] Using Key [%s]", key)
160+
if "blocklists" in key_payload:
161+
logger.debug("[SYNC] [blocklists] to be filtered")
162+
key_payload["blocklists"] = filter_blocklists(key_payload["blocklists"])
163+
try:
164+
if isinstance(key_payload, list):
165+
update_array_settings(profile_id, key, key_payload)
166+
else:
167+
update_profile_settings(profile_id, key_payload, key)
168+
logger.info("[SYNC] Successfully updated %s for profile %s.", key, profile_id)
169+
except Exception as e:
170+
logger.error("[SYNC] Failed to update %s for profile %s: %s", key, profile_id, e)
171171

172172
except Exception as e:
173173
logger.error("[SYNC] Failed to sync profiles: %s", e)

0 commit comments

Comments
 (0)