Skip to content

Commit b87478f

Browse files
committed
add fix from dr_test branch
1 parent b97f2fa commit b87478f

1 file changed

Lines changed: 3 additions & 13 deletions

File tree

src/scripts/populate.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ const Cve = require('../model/cve')
1717
const Org = require('../model/org')
1818
const User = require('../model/user')
1919
const BaseOrg = require('../model/baseorg')
20-
const RegistryOrg = require('../model/registry-org')
21-
const RegistryUser = require('../model/registry-user')
2220
const BaseUser = require('../model/baseuser')
2321

2422
const error = new errors.IDRError()
@@ -29,8 +27,6 @@ const populateTheseCollections = {
2927
'Cve-Id': CveId,
3028
User: User,
3129
Org: Org,
32-
RegistryOrg: RegistryOrg,
33-
RegistryUser: RegistryUser,
3430
BaseOrg: BaseOrg,
3531
BaseUser: BaseUser
3632
}
@@ -76,8 +72,8 @@ db.once('open', async () => {
7672

7773
// drops and re-populates collections
7874
if (userInput.toLowerCase() === 'y') {
79-
let names = []
80-
let collections = await db.db.listCollections().toArray()
75+
const names = []
76+
const collections = await db.db.listCollections().toArray()
8177
collections.forEach(collection => {
8278
names.push(collection.name)
8379
})
@@ -91,13 +87,7 @@ db.once('open', async () => {
9187
}
9288
}
9389

94-
names = []
95-
collections = await db.db.listCollections().toArray()
96-
collections.forEach(collection => {
97-
names.push(collection.name)
98-
})
99-
100-
if (!names.includes('Cve-Id-Range') && !names.includes('Cve-Id') && !names.includes('Cve') && !names.includes('Org') && !names.includes('User')) {
90+
if (!names.includes('Cve-Id-Range') && !names.includes('Cve-Id') && !names.includes('Cve') && !names.includes('Org') && !names.includes('User') && !names.includes('BaseOrg') && !names.includes('BaseUser')) {
10191
// Org
10292
await dataUtils.populateCollection(
10393
'./datadump/pre-population/orgs.json',

0 commit comments

Comments
 (0)