Fix mailbox edit form: pre-populate fields, prevent credential overwrite, lock immutable settings

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/christianlouis/pop_puller_to_gmail/sessions/20fa7a89-23e5-462c-8b4d-9c6cdb4d0501
This commit is contained in:
copilot-swe-agent[bot]
2026-03-25 23:00:00 +00:00
parent 6bea660d16
commit 20170f2f2d
5 changed files with 93 additions and 39 deletions
@@ -146,9 +146,9 @@ async def update_mail_account(
update_data = account_update.model_dump(exclude_unset=True)
if "password" in update_data:
update_data["encrypted_password"] = encrypt_credential(
update_data.pop("password")
)
password = update_data.pop("password")
if password: # Only update when a non-empty password is provided
update_data["encrypted_password"] = encrypt_credential(password)
for field, value in update_data.items():
setattr(account, field, value)