Skip to content
Snippets Groups Projects
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
Branches
Tags release-2.6.3
No related merge requests found
......@@ -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."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment