Skip to content

Commit 027db02

Browse files
add hotfix to reduce dataset (#1337)
* add hotfix to reduce dataset * revert changes to yarn lock * revert end line changes to yarn lock * clarified conditions to apply unverified role * fix linting errors --------- Co-authored-by: Ankush Dharkar <[email protected]>
1 parent 117737b commit 027db02

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

controllers/users.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,11 @@ const markUnverified = async (req, res) => {
324324
});
325325

326326
usersInRdsDiscordServer.forEach((discordUser) => {
327-
const found = discordUser.roles.find((role) => role === discordDeveloperRoleId);
328-
if (found && !rdsUserMap[discordUser.user.id]) {
327+
const isDeveloper = discordUser.roles.includes(discordDeveloperRoleId);
328+
const isMissingUnverifiedRole = !discordUser.roles.includes(unverifiedRoleId);
329+
const isUserUnverified = !rdsUserMap[discordUser.user.id]; // Doesn't have discordId in RDS user object
330+
331+
if (isDeveloper && isUserUnverified && isMissingUnverifiedRole) {
329332
usersToApplyUnverifiedRole.push(discordUser.user.id);
330333
}
331334
});

0 commit comments

Comments
 (0)