Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧑‍💻(domains) change default ordering #717

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/backend/mailbox_manager/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class Meta:
db_table = "people_mail_domain"
verbose_name = _("Mail domain")
verbose_name_plural = _("Mail domains")
ordering = ["-created_at"]

def __str__(self):
return self.name
Expand Down Expand Up @@ -109,6 +110,7 @@ class Meta:
verbose_name = _("User/mail domain relation")
verbose_name_plural = _("User/mail domain relations")
unique_together = ("user", "domain")
ordering = ["-created_at"]

def __str__(self):
return f"Access of user {self.user} on domain {self.domain}."
Expand Down Expand Up @@ -206,6 +208,7 @@ class Meta:
verbose_name = _("Mailbox")
verbose_name_plural = _("Mailboxes")
unique_together = ("local_part", "domain")
ordering = ["-created_at"]

def __str__(self):
return f"{self.local_part!s}@{self.domain.name:s}"
Expand Down
4 changes: 2 additions & 2 deletions src/backend/mailbox_manager/tests/test_utils_dimail_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,13 @@ def test_dimail__enable_pending_mailboxes(caplog):
)
assert (
caplog.records[2].message
== f"Information for mailbox mock@{domain.name} sent to {mailbox1.secondary_email}."
== f"Information for mailbox mock@{domain.name} sent to {mailbox2.secondary_email}."
)
assert (
caplog.records[4].message
== f"Mailbox successfully created on domain {domain.name} by user None"
)
assert (
caplog.records[5].message
== f"Information for mailbox mock@{domain.name} sent to {mailbox2.secondary_email}."
== f"Information for mailbox mock@{domain.name} sent to {mailbox1.secondary_email}."
)
Loading