You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Function to delete the alert given (with key "fa_alert_id" in the payload).
162
+
Deletes the given alert via AeroAPI DELETE call and then deletes it from the
163
+
SQLite database. Returns JSON Response in form {"Success": True/False,
164
+
"Description": <A detailed description of the response>}
165
+
"""
161
166
r_success: bool=False
162
167
r_description: str
163
168
# Process json
@@ -176,13 +181,17 @@ def delete_alert():
176
181
# return to front end the error, decode and clean the response
177
182
try:
178
183
processed_json=result.json()
179
-
r_description=f"Error code {result.status_code} with the following description: {processed_json['detail']}"
184
+
r_description=f"Error code {result.status_code} with the following description for alert configuration {fa_alert_id}: {processed_json['detail']}"
180
185
exceptjson.decoder.JSONDecodeError:
181
-
r_description=f"Error code {result.status_code} could not be parsed into JSON. The following is the HTML response given: {result.text}"
186
+
r_description=f"Error code {result.status_code}for the alert configuration {fa_alert_id}could not be parsed into JSON. The following is the HTML response given: {result.text}"
182
187
else:
183
188
# Check if data was inserted into database properly
184
189
ifdelete_from_table(fa_alert_id) ==-1:
185
-
r_description="Error deleting the alert configuration from the SQL Database"
190
+
r_description= (
191
+
"Error deleting the alert configuration from the SQL Database - since it was deleted "
192
+
"on AeroAPI but not locally, this means the alert will still be shown on the table - in order to "
193
+
"properly delete the alert please look in your local Sqlite database."
194
+
)
186
195
else:
187
196
r_success=True
188
197
r_description=f"Request sent successfully, alert configuration {fa_alert_id} has been deleted"
0 commit comments