feat: Add effects field to Risk model and display in risk item template
This commit is contained in:
parent
86525d9ab0
commit
ed300ca403
7 changed files with 61 additions and 2 deletions
Binary file not shown.
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
17
risks/migrations/0024_risk_effects.py
Normal file
17
risks/migrations/0024_risk_effects.py
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# Generated by Django 5.2.6 on 2025-09-10 12:44
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
dependencies = [
|
||||||
|
("risks", "0023_notificationrule"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name="risk",
|
||||||
|
name="effects",
|
||||||
|
field=models.TextField(blank=True, null=True, verbose_name="Effects"),
|
||||||
|
),
|
||||||
|
]
|
19
risks/migrations/0025_alter_control_risks.py
Normal file
19
risks/migrations/0025_alter_control_risks.py
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# Generated by Django 5.2.6 on 2025-09-10 12:59
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
dependencies = [
|
||||||
|
("risks", "0024_risk_effects"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="control",
|
||||||
|
name="risks",
|
||||||
|
field=models.ManyToManyField(
|
||||||
|
blank=True, null=True, related_name="controls", to="risks.risk"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
19
risks/migrations/0026_alter_control_risks.py
Normal file
19
risks/migrations/0026_alter_control_risks.py
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# Generated by Django 5.2.6 on 2025-09-10 12:59
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
dependencies = [
|
||||||
|
("risks", "0025_alter_control_risks"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="control",
|
||||||
|
name="risks",
|
||||||
|
field=models.ManyToManyField(
|
||||||
|
blank=True, related_name="controls", to="risks.risk"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
|
@ -68,7 +68,7 @@ class Risk(models.Model):
|
||||||
category = models.CharField(_("Category"), max_length=255, blank=True, null=True)
|
category = models.CharField(_("Category"), max_length=255, blank=True, null=True)
|
||||||
created_at = models.DateTimeField(_("Created at"), auto_now_add=True)
|
created_at = models.DateTimeField(_("Created at"), auto_now_add=True)
|
||||||
updated_at = models.DateTimeField(_("Updated at"), auto_now=True)
|
updated_at = models.DateTimeField(_("Updated at"), auto_now=True)
|
||||||
|
effects = models.TextField(_("Effects"), blank=True, null=True)
|
||||||
status = models.CharField(
|
status = models.CharField(
|
||||||
_("Status"),
|
_("Status"),
|
||||||
max_length=20,
|
max_length=20,
|
||||||
|
@ -212,7 +212,7 @@ class Control(models.Model):
|
||||||
updated_at = models.DateTimeField(auto_now=True)
|
updated_at = models.DateTimeField(auto_now=True)
|
||||||
|
|
||||||
# Relation to risk
|
# Relation to risk
|
||||||
risks = models.ManyToManyField("Risk", related_name="controls")
|
risks = models.ManyToManyField("Risk", related_name="controls", blank=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f"{self.title} ({self.get_status_display()})"
|
return f"{self.title} ({self.get_status_display()})"
|
||||||
|
|
|
@ -70,6 +70,10 @@
|
||||||
<p><strong>{% trans "Resubmission" %}:</strong> {{ risk.follow_up|date:'d.m.Y' }}</p>
|
<p><strong>{% trans "Resubmission" %}:</strong> {{ risk.follow_up|date:'d.m.Y' }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<section>
|
||||||
|
<h3>Auswirkungen</h3>
|
||||||
|
<p>{{ risk.effects }}</p>
|
||||||
|
</section>
|
||||||
<!-- Risikobewertung -->
|
<!-- Risikobewertung -->
|
||||||
<section class="hero has-text-centered is-small">
|
<section class="hero has-text-centered is-small">
|
||||||
<div class="hero-body">
|
<div class="hero-body">
|
||||||
|
|
Loading…
Add table
Reference in a new issue