Skip to content

Commit bec6f5b

Browse files
authored
Merge pull request #1583 from CVEProject/migrate_fixes
Migrate script fixes.
2 parents 3b649c4 + c0b98e7 commit bec6f5b

File tree

3 files changed

+4
-262
lines changed

3 files changed

+4
-262
lines changed

datadump/pre-population/registry-orgs.json

Lines changed: 0 additions & 147 deletions
This file was deleted.

datadump/pre-population/registry-users.json

Lines changed: 0 additions & 114 deletions
This file was deleted.

src/scripts/migrate.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,10 @@ async function orgHelper (db) {
164164
// Pull from the CNA object
165165
rootTlr = Object.hasOwn(currentCNA, 'CNA') ? currentCNA.CNA.isRoot : false
166166
charterScope = Object.hasOwn(currentCNA, 'scope') ? currentCNA.scope : null
167-
disclosure = Object.hasOwn(currentCNA, 'disclosurePolicy') ? currentCNA.disclosurePolicy : null
167+
disclosure = (currentCNA.disclosurePolicy || [])
168+
.map(policy => policy?.url) // Extract the URL (safely)
169+
.filter(url => url) // Remove empty/null/undefined URLs
170+
.join(';')
168171
email = currentCNA.contact[0].email.length > 0 ? currentCNA.contact[0].email[0].emailAddr : null
169172
site = currentCNA.contact[0].contact.length > 0 ? currentCNA.contact[0].contact[0].url : null
170173
}

0 commit comments

Comments
 (0)