-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/flash_mode
- Loading branch information
Showing
10 changed files
with
6,023 additions
and
4,164 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Generated by Django 5.0.4 on 2024-05-22 17:31 | ||
|
||
from core.models import StoredLibrary, LoadedLibrary | ||
from django.db import migrations, models | ||
|
||
|
||
def fix_urns_for_enisa_5g_scm(apps, schema_editor): | ||
enisa_5g_scm_stored_library = StoredLibrary.objects.filter( | ||
urn="urn:intuitem:risk:library:enisa-5g-scm-v1.3" | ||
) | ||
if enisa_5g_scm_stored_library: | ||
enisa_5g_scm_stored_library[ | ||
0 | ||
].delete() # the lib will be added again in the store at the end of the migration | ||
enisa_5g_scm_loaded_library = LoadedLibrary.objects.filter( | ||
urn="urn:intuitem:risk:library:enisa-5g-scm-v1.3" | ||
) | ||
if enisa_5g_scm_loaded_library: | ||
count = 0 | ||
for b in enisa_5g_scm_loaded_library[0].reference_controls.all(): | ||
if b.urn[:4] != "urn:": | ||
b.urn = "urn:intuitem:" + b.urn | ||
b.save() | ||
count += 1 | ||
print(f"fixed {count} URNs") | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("core", "0013_requirementnode_typical_evidence"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(fix_urns_for_enisa_5g_scm), | ||
] |
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
Oops, something went wrong.