Skip to content

Commit a303d39

Browse files
authored
Merge pull request #1558 from CVEProject/reported_bug_amazon
Fix reported bug with Migration.
2 parents afc616b + c3efb34 commit a303d39

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/scripts/migrate.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,14 @@ async function orgHelper (db) {
133133

134134
// Find associated users with the Org
135135
const orgUsers = []
136+
const admins = []
136137

137138
for (const user of allUsers) {
138139
if (user.org_UUID === doc.UUID) {
139140
orgUsers.push(user.UUID)
141+
if (user.authority?.active_roles?.includes('ADMIN')) {
142+
admins.push(user.UUID)
143+
}
140144
}
141145
}
142146

@@ -185,12 +189,12 @@ async function orgHelper (db) {
185189
product_list: null, // don't have now
186190
soft_quota: null, // don't have now
187191
hard_quota: doc.policies?.id_quota,
192+
admins: admins,
188193
contact_info: {
189194
additional_contact_users: [], // don't have now
190195
poc: null, // don't have now
191196
poc_email: null, // don't have now
192197
poc_phone: null, // don't have now
193-
admins: [], // don't have now
194198
org_email: email,
195199
website: site
196200
},

src/utils/data.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ async function newUserTransform (user, hash) {
6262
const tmpOrgUUID = await utils.getOrgUUID(user.cna_short_name)
6363
user.org_UUID = tmpOrgUUID
6464
user.UUID = uuid.v4()
65-
user.authority = { active_roles: [] }
6665

6766
// shared secret key in development environments
6867
if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {

0 commit comments

Comments
 (0)