diff --git a/app/org/maproulette/framework/service/UserService.scala b/app/org/maproulette/framework/service/UserService.scala index f614b3eb..ba02db74 100644 --- a/app/org/maproulette/framework/service/UserService.scala +++ b/app/org/maproulette/framework/service/UserService.scala @@ -110,7 +110,9 @@ class UserService @Inject() ( } def promoteSuperUsersInConfig(): Unit = { - val usersToPromote: List[User] = config.superAccounts + // Look at config.superAccounts and ensure that all of those users are superusers. The below List will contain + // both the promoted users and the users that were already superusers. + val superusersFromConfig: List[User] = config.superAccounts .filter(_ != "*") .flatMap { osmId => retrieveByOSMId(osmId.toLong) match { @@ -123,19 +125,8 @@ class UserService @Inject() ( } } .flatMap { user => - if (isSuperUser(user.id)) { - logger.info( - s"MapRoulette uid=${user.id} (osm_id=${user.osmProfile.id}) is already a superuser, skipping role promotion" - ) - None - } else { - Some(user) - } + if (promoteUserToSuperUser(user, User.superUser)) Some(user) else None } - - usersToPromote.foreach { user => - promoteUserToSuperUser(user, User.superUser) - } } private def seedSuperUserIds(): Unit = {