Unverified Commit 33ca9296 authored by Ahmad Farhat's avatar Ahmad Farhat Committed by GitHub
Browse files

Fixed Role not exist warning in user create (#1737)

parent a61b9628
......@@ -23,6 +23,12 @@ namespace :user do
puts "Missing Arguments"
exit
end
unless Role.exists?(name: u[:role], provider: u[:provider])
puts "Invalid Role - Role does not exist"
exit
end
u[:email].prepend "superadmin-" if args[:role] == "super_admin"
# Create account if it doesn't exist
......@@ -36,11 +42,6 @@ namespace :user do
exit
end
unless Role.exists?(name: u[:role], provider: u[:provider])
puts "Invalid Role - Role does not exist"
exit
end
user.set_role(u[:role])
puts "Account succesfully created."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment