fix: address code review - Alpine.js $set, SQLAlchemy bool filter style

Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/f141cd3b-8d0a-4c7e-b479-ee973c209c11

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-29 16:20:11 +00:00
parent 6d9392e5e7
commit 883d54a428
2 changed files with 3 additions and 5 deletions
+2 -2
View File
@@ -454,7 +454,7 @@ function mailSourcesApp() {
}, },
async testSource(id) { async testSource(id) {
this.$set(this.testing, id, true); this.testing[id] = true;
this.feedback = { message: '', type: '' }; this.feedback = { message: '', type: '' };
try { try {
const resp = await fetch(`/api/v1/mail-sources/${id}/test`, { method: 'POST' }); const resp = await fetch(`/api/v1/mail-sources/${id}/test`, { method: 'POST' });
@@ -474,7 +474,7 @@ function mailSourcesApp() {
} catch (e) { } catch (e) {
this.feedback = { message: `Test error: ${e.message}`, type: 'error' }; this.feedback = { message: `Test error: ${e.message}`, type: 'error' };
} finally { } finally {
this.$set(this.testing, id, false); this.testing[id] = false;
} }
}, },
+1 -3
View File
@@ -147,9 +147,7 @@ class TestMailSourcesAPI:
db_session.add(MailSource(name="Disabled", method="IMAP", enabled=False)) db_session.add(MailSource(name="Disabled", method="IMAP", enabled=False))
db_session.commit() db_session.commit()
enabled = ( enabled = db_session.query(MailSource).filter(MailSource.enabled).all()
db_session.query(MailSource).filter(MailSource.enabled == True).all() # noqa: E712
)
assert len(enabled) == 2 assert len(enabled) == 2
names = {s.name for s in enabled} names = {s.name for s in enabled}
assert "Enabled A" in names assert "Enabled A" in names