From 7bb3b12e11ae0bdfa5dcf1b5233fd353bfb5c854 Mon Sep 17 00:00:00 2001 From: Donald Zou Date: Thu, 9 Jan 2025 17:04:19 +0800 Subject: [PATCH] Update dashboard.py --- src/dashboard.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dashboard.py b/src/dashboard.py index 9ba172a..1a5c128 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -2286,10 +2286,10 @@ def API_getDashboardVersion(): @app.post(f'{APP_PREFIX}/api/savePeerScheduleJob/') def API_savePeerScheduleJob(): data = request.json - if "Job" not in data.keys() not in WireguardConfigurations.keys(): + if "Job" not in data.keys(): return ResponseObject(False, "Please specify job") job: dict = data['Job'] - if "Peer" not in job.keys() or "Configuration" not in job.keys(): + if "Peer" not in job.keys() or "Configuration" not in job.keys() or job['Configuration'] not in WireguardConfigurations.keys(): return ResponseObject(False, "Please specify peer and configuration") configuration = WireguardConfigurations.get(job['Configuration']) f, fp = configuration.searchPeer(job['Peer']) @@ -2306,10 +2306,10 @@ def API_savePeerScheduleJob(): @app.post(f'{APP_PREFIX}/api/deletePeerScheduleJob/') def API_deletePeerScheduleJob(): data = request.json - if "Job" not in data.keys() not in WireguardConfigurations.keys(): + if "Job" not in data.keys(): return ResponseObject(False, "Please specify job") job: dict = data['Job'] - if "Peer" not in job.keys() or "Configuration" not in job.keys(): + if "Peer" not in job.keys() or "Configuration" not in job.keys() or job['Configuration'] not in WireguardConfigurations.keys(): return ResponseObject(False, "Please specify peer and configuration") configuration = WireguardConfigurations.get(job['Configuration']) f, fp = configuration.searchPeer(job['Peer'])