Fix automatic mail import unable to be disabled once enabled
Fixed the same checkbox bug for the automatic mail import setting. The enable checkbox could not be unchecked due to HTML forms not sending unchecked checkbox values. Solution: Added import_form_touched flag to detect when the import settings form is submitted, then update the checkbox value based on presence (checked) or absence (unchecked) in form data. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
1cdb343201
commit
4acc64cc0a
@ -408,6 +408,7 @@ def settings():
|
|||||||
|
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
autotask_form_touched = any(str(k).startswith("autotask_") for k in (request.form or {}).keys())
|
autotask_form_touched = any(str(k).startswith("autotask_") for k in (request.form or {}).keys())
|
||||||
|
import_form_touched = any(str(k).startswith("auto_import_") or str(k).startswith("manual_import_") or str(k).startswith("ingest_eml_") for k in (request.form or {}).keys())
|
||||||
|
|
||||||
# NOTE: The Settings UI has multiple tabs with separate forms.
|
# NOTE: The Settings UI has multiple tabs with separate forms.
|
||||||
# Only update values that are present in the submitted form, to avoid
|
# Only update values that are present in the submitted form, to avoid
|
||||||
@ -507,7 +508,9 @@ def settings():
|
|||||||
settings.daily_jobs_start_date = None
|
settings.daily_jobs_start_date = None
|
||||||
|
|
||||||
# Import configuration
|
# Import configuration
|
||||||
if "auto_import_enabled" in request.form:
|
# Checkbox: only update when any import field is present (form was submitted)
|
||||||
|
# Unchecked checkboxes are not sent by browsers, so check import_form_touched
|
||||||
|
if import_form_touched:
|
||||||
settings.auto_import_enabled = bool(request.form.get("auto_import_enabled"))
|
settings.auto_import_enabled = bool(request.form.get("auto_import_enabled"))
|
||||||
|
|
||||||
if "auto_import_interval_minutes" in request.form:
|
if "auto_import_interval_minutes" in request.form:
|
||||||
|
|||||||
@ -33,6 +33,7 @@ This file documents all changes made to this project via Claude Code.
|
|||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Autotask integration can now be disabled in Settings after being enabled (fixed unchecked checkbox not being processed)
|
- Autotask integration can now be disabled in Settings after being enabled (fixed unchecked checkbox not being processed)
|
||||||
|
- Automatic mail import can now be disabled in Settings after being enabled (fixed unchecked checkbox not being processed)
|
||||||
- Autotask "Link existing" search box now clears when opening the modal instead of retaining previous search text
|
- Autotask "Link existing" search box now clears when opening the modal instead of retaining previous search text
|
||||||
- Autotask customer mapping search box now clears when opening the edit modal instead of retaining previous search text
|
- Autotask customer mapping search box now clears when opening the edit modal instead of retaining previous search text
|
||||||
- Autotask ticket resolution update now correctly preserves exact field values from GET response in PUT payload.
|
- Autotask ticket resolution update now correctly preserves exact field values from GET response in PUT payload.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user