Fixed user create task failing with invalid role (#1751)

This commit is contained in:
Ahmad Farhat 2020-06-04 14:08:25 -04:00 committed by GitHub
parent f9e85aadb9
commit 959cfe0425
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,9 @@ namespace :user do
exit
end
# Create the default roles if not already created
Role.create_default_roles(u[:provider]) if Role.where(provider: u[:provider]).count.zero?
unless Role.exists?(name: u[:role], provider: u[:provider])
puts "Invalid Role - Role does not exist"
exit