🐛(mailbox) fix migration to fill dn_email field

Fix AttributeError
'Mailbox' object has no attribute 'get_email'
This commit is contained in:
Sabrina Demagny
2025-03-04 13:19:32 +01:00
committed by BEY Quentin
parent ef4c1da78c
commit d5b154fbe0
2 changed files with 5 additions and 1 deletions

View File

@@ -8,6 +8,10 @@ and this project adheres to
## [Unreleased]
### Fixed
- 🐛(mailbox) fix migration to fill dn_email field
## [1.13.0] - 2025-03-04
### Added

View File

@@ -12,7 +12,7 @@ def fill_dn_email(apps, schema_editor):
models.Q(dn_email="") | models.Q(dn_email__isnull=True)
):
# quite naive but we don't have many data
mailbox.dn_email = mailbox.get_email()
mailbox.dn_email = f"{mailbox.local_part}@{mailbox.domain.name}"
mailbox.save()