From 757f002eab4e8ccfa829b0544598e2b27fad180e Mon Sep 17 00:00:00 2001 From: monsieurswag Date: Wed, 28 Feb 2024 16:07:24 +0100 Subject: [PATCH] Put the is_publised attribute in the AbstractBaseModel class --- backend/core/base_models.py | 1 + backend/core/models.py | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/core/base_models.py b/backend/core/base_models.py index 155248999..588700806 100644 --- a/backend/core/base_models.py +++ b/backend/core/base_models.py @@ -11,6 +11,7 @@ class AbstractBaseModel(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) created_at = models.DateTimeField(auto_now_add=True, verbose_name=_("Created at")) updated_at = models.DateTimeField(auto_now=True, verbose_name=_("UpdatedÒ at")) + is_published = models.BooleanField(_("published"), default=True) class Meta: abstract = True diff --git a/backend/core/models.py b/backend/core/models.py index a9ad4411f..4715b9b3f 100644 --- a/backend/core/models.py +++ b/backend/core/models.py @@ -140,7 +140,6 @@ class Threat(ReferentialObjectMixin): library = models.ForeignKey( Library, on_delete=models.CASCADE, null=True, blank=True, related_name="threats" ) - is_published = models.BooleanField(_("published"), default=True) class Meta: verbose_name = _("Threat") @@ -189,7 +188,6 @@ class SecurityFunction(ReferentialObjectMixin): typical_evidence = models.JSONField( verbose_name=_("Typical evidence"), null=True, blank=True ) - is_published = models.BooleanField(_("published"), default=True) class Meta: verbose_name = _("Security function") @@ -423,7 +421,6 @@ class Type(models.TextChoices): parent_assets = models.ManyToManyField( "self", blank=True, verbose_name=_("parent assets"), symmetrical=False ) - is_published = models.BooleanField(_("published"), default=True) fields_to_check = ["name"]