🗃️(mailbox_manager) add organization to domain

To be able to provide a SIRET in the ProConnect IdP process
we need to be able to link a mail domain to its organization.
For now this is not mandatory, as we can't detect the organization
and need a frontend process to clarify it.
This commit is contained in:
Quentin BEY
2025-02-10 12:11:31 +01:00
committed by BEY Quentin
parent a386c61729
commit 8faa049046
5 changed files with 103 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ from django.db import models
from django.utils.text import slugify
from django.utils.translation import gettext_lazy as _
from core.models import BaseModel
from core.models import BaseModel, Organization
from mailbox_manager.enums import (
MailboxStatusChoices,
@@ -23,6 +23,13 @@ class MailDomain(BaseModel):
name = models.CharField(
_("name"), max_length=150, null=False, blank=False, unique=True
)
organization = models.ForeignKey(
Organization,
on_delete=models.PROTECT,
related_name="mail_domains",
null=True,
blank=True,
)
slug = models.SlugField(null=False, blank=False, unique=True, max_length=80)
status = models.CharField(
max_length=20,