-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #826 from intuitem/feat/attach-folder-to-assessment
Feat/attach folder to assessment
- Loading branch information
Showing
7 changed files
with
287 additions
and
7 deletions.
There are no files selected for viewing
187 changes: 187 additions & 0 deletions
187
backend/core/migrations/0025_complianceassessment_folder_riskassessment_folder_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
# Generated by Django 5.1.1 on 2024-09-12 15:00 | ||
|
||
import django.db.models.deletion | ||
import iam.models | ||
from django.db import migrations, models | ||
|
||
|
||
def set_assessment_folder(apps, schema_editor): | ||
RiskAssessment = apps.get_model("core", "RiskAssessment") | ||
ComplianceAssessment = apps.get_model("core", "ComplianceAssessment") | ||
for risk_assessment in RiskAssessment.objects.all(): | ||
risk_assessment.folder = risk_assessment.project.folder | ||
risk_assessment.save() | ||
for compliance_assessment in ComplianceAssessment.objects.all(): | ||
compliance_assessment.folder = compliance_assessment.project.folder | ||
compliance_assessment.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("core", "0024_appliedcontrol_owner"), | ||
("iam", "0006_alter_role_folder_alter_roleassignment_folder_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="complianceassessment", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="riskassessment", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="appliedcontrol", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="asset", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="evidence", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="framework", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="loadedlibrary", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="project", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="referencecontrol", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="requirementassessment", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="requirementmappingset", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="requirementnode", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="riskacceptance", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="riskmatrix", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="storedlibrary", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="threat", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
migrations.RunPython(set_assessment_folder), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
backend/global_settings/migrations/0002_alter_globalsettings_folder.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 5.1.1 on 2024-09-12 15:00 | ||
|
||
import django.db.models.deletion | ||
import iam.models | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("global_settings", "0001_initial"), | ||
("iam", "0006_alter_role_folder_alter_roleassignment_folder_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="globalsettings", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
] |
54 changes: 54 additions & 0 deletions
54
backend/iam/migrations/0006_alter_role_folder_alter_roleassignment_folder_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Generated by Django 5.1.1 on 2024-09-12 15:00 | ||
|
||
import django.db.models.deletion | ||
import iam.models | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("iam", "0005_alter_user_managers"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="role", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="roleassignment", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="user", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="usergroup", | ||
name="folder", | ||
field=models.ForeignKey( | ||
default=iam.models.Folder.get_root_folder_id, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="%(class)s_folder", | ||
to="iam.folder", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters