🩹(mailbox) fix status of current mailboxes
All mailboxes created so far should be in active status
This commit is contained in:
committed by
BEY Quentin
parent
17a1c39dbf
commit
a57070bfb8
@@ -8,6 +8,10 @@ and this project adheres to
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- 🩹(mailbox) fix status of current mailboxes
|
||||||
|
|
||||||
## [1.6.0] - 2024-11-20
|
## [1.6.0] - 2024-11-20
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class MailDomainAdmin(admin.ModelAdmin):
|
|||||||
class MailboxAdmin(admin.ModelAdmin):
|
class MailboxAdmin(admin.ModelAdmin):
|
||||||
"""Admin for mailbox model."""
|
"""Admin for mailbox model."""
|
||||||
|
|
||||||
list_display = ("__str__", "first_name", "last_name")
|
list_display = ("__str__", "first_name", "last_name", "status")
|
||||||
|
|
||||||
|
|
||||||
@admin.register(models.MailDomainAccess)
|
@admin.register(models.MailDomainAccess)
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
from mailbox_manager import enums
|
||||||
|
|
||||||
|
def change_mailboxes_status_to_enabled(apps, schema_editor):
|
||||||
|
Mailbox = apps.get_model('mailbox_manager', 'Mailbox')
|
||||||
|
Mailbox.objects.filter(status=enums.MailboxStatusChoices.PENDING).update(status=enums.MailboxStatusChoices.ENABLED)
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('mailbox_manager', '0014_mailbox_status'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RunPython(change_mailboxes_status_to_enabled, reverse_code=migrations.RunPython.noop),
|
||||||
|
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user