mirror of
https://github.com/simple-login/app.git
synced 2025-10-20 12:17:13 +08:00
update contact.mail_from and contact.from_header if needed
This commit is contained in:
parent
5681f061b5
commit
8f6550f992
1 changed files with 20 additions and 0 deletions
|
@ -178,6 +178,26 @@ def get_or_create_contact(
|
||||||
)
|
)
|
||||||
contact.name = contact_name
|
contact.name = contact_name
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
if contact.mail_from != mail_from:
|
||||||
|
LOG.d(
|
||||||
|
"Update contact %s mail_from %s to %s",
|
||||||
|
contact,
|
||||||
|
contact.mail_from,
|
||||||
|
mail_from,
|
||||||
|
)
|
||||||
|
contact.mail_from = mail_from
|
||||||
|
db.session.commit()
|
||||||
|
|
||||||
|
if contact.from_header != contact_from_header:
|
||||||
|
LOG.d(
|
||||||
|
"Update contact %s from_header %s to %s",
|
||||||
|
contact,
|
||||||
|
contact.from_header,
|
||||||
|
contact_from_header,
|
||||||
|
)
|
||||||
|
contact.from_header = contact_from_header
|
||||||
|
db.session.commit()
|
||||||
else:
|
else:
|
||||||
LOG.debug(
|
LOG.debug(
|
||||||
"create contact for alias %s and contact %s",
|
"create contact for alias %s and contact %s",
|
||||||
|
|
Loading…
Add table
Reference in a new issue