Skip to content

Commit

Permalink
Fixed Role not exist warning in user create (#1737)
Browse files Browse the repository at this point in the history
  • Loading branch information
farhatahmad committed Jun 3, 2020
1 parent a61b962 commit 33ca929
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/tasks/user.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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."
Expand Down

1 comment on commit 33ca929

@bertaladil
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Farahat,
i have all the update today for greenlight,
i still have this issue
Invalid Role - Role does not exist
when i execute
docker exec greenlight-v2 bundle exec rake user:create["admin","myemail@yahoo.fr","root@@","admin"]
please how can i avoid that,
is there any default admin/password

thank you very much,
Adil

Please sign in to comment.