Skip to content

Commit

Permalink
fix loaded library issue (#1021)
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-intuitem authored Nov 7, 2024
1 parent 7e710f1 commit 6112b1e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
21 changes: 21 additions & 0 deletions backend/core/migrations/0034_fix_loaded_libraries_objects_meta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 5.1 on 2024-11-07 12:10

from django.db import migrations


def fix_libraries_objects_meta(apps, schema_editor):
LoadedLibrary = apps.get_model("core", "LoadedLibrary")

for library in LoadedLibrary.objects.all():
objects_meta = library.objects_meta
if "frameworks" in objects_meta:
objects_meta["framework"] = objects_meta.pop("frameworks")
library.save()


class Migration(migrations.Migration):
dependencies = [
("core", "0033_fix_mitre_lib_version"),
]

operations = [migrations.RunPython(fix_libraries_objects_meta)]
7 changes: 1 addition & 6 deletions frontend/src/lib/utils/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,7 @@ const LIBRARY_TYPE_FILTER = {
return datatypes;
},
extraProps: {
defaultOptionName: 'objectType',
optionLabels: {
reference_controls: 'referenceControls',
requirement_mapping_set: 'requirementMappingSet',
risk_matrix: 'riskMatrix'
}
defaultOptionName: 'objectType'
},
alwaysDisplay: true
};
Expand Down

0 comments on commit 6112b1e

Please sign in to comment.