Skip to content

Commit

Permalink
Prepare model
Browse files Browse the repository at this point in the history
  • Loading branch information
kiblik committed Aug 26, 2024
1 parent 096bd04 commit 8395c49
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
24 changes: 24 additions & 0 deletions dojo/db_migrations/0214_engagement_sla_configuration_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 4.1.13 on 2024-04-25 09:44

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('dojo', '0213_system_settings_enable_ui_table_based_searching'),
]

operations = [
migrations.AddField(
model_name='engagement',
name='sla_configuration',
field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.RESTRICT, to='dojo.sla_configuration'),
),
migrations.AddField(
model_name='test',
name='sla_configuration',
field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.RESTRICT, to='dojo.sla_configuration'),
),
]
10 changes: 10 additions & 0 deletions dojo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1465,6 +1465,11 @@ class Engagement(models.Model):
source_code_management_uri = models.URLField(max_length=600, null=True, blank=True, editable=True, verbose_name=_("Repo"), help_text=_("Resource link to source code"))
orchestration_engine = models.ForeignKey(Tool_Configuration, verbose_name=_("Orchestration Engine"), help_text=_("Orchestration service responsible for CI/CD test"), null=True, blank=True, related_name="orchestration", on_delete=models.CASCADE)
deduplication_on_engagement = models.BooleanField(default=False, verbose_name=_("Deduplication within this engagement only"), help_text=_("If enabled deduplication will only mark a finding in this engagement as duplicate of another finding if both findings are in this engagement. If disabled, deduplication is on the product level."))
sla_configuration = models.ForeignKey(SLA_Configuration,
null=True,
blank=True,
default=None,
on_delete=models.RESTRICT)

tags = TagField(blank=True, force_lowercase=True, help_text=_("Add tags that help describe this engagement. Choose from the list or add new tags. Press Enter key to add."))
inherited_tags = TagField(blank=True, force_lowercase=True, help_text=_("Internal use tags sepcifically for maintaining parity with product. This field will be present as a subset in the tags field"))
Expand Down Expand Up @@ -2059,6 +2064,11 @@ class Test(models.Model):
branch_tag = models.CharField(editable=True, max_length=150,
null=True, blank=True, help_text=_("Tag or branch that was tested, a reimport may update this field."), verbose_name=_("Branch/Tag"))
api_scan_configuration = models.ForeignKey(Product_API_Scan_Configuration, null=True, editable=True, blank=True, on_delete=models.CASCADE, verbose_name=_("API Scan Configuration"))
sla_configuration = models.ForeignKey(SLA_Configuration,
null=True,
blank=True,
default=None,
on_delete=models.RESTRICT)

class Meta:
indexes = [
Expand Down

0 comments on commit 8395c49

Please sign in to comment.