1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-19 13:54:25 +01:00

[Bug] unable to create the first user because role member was missing

This commit is contained in:
Nicolas Florentin 2019-09-09 14:34:00 +02:00 committed by Sylvain
parent 87f3aa1d65
commit 3c486e4b93
2 changed files with 2 additions and 1 deletions

View File

@ -5,6 +5,7 @@
- Upgrade dev environments from ruby 2.3.6 to 2.3.8 (#143)
- Fix a bug: Users with role 'member' cannot download their invoices
- Fix a bug: Wallet credit inputs does not allow to put zeros at the end of the decimal part of the amount
- Fix a bug: unable to create the first user because role member was missing
- [TODO DEPLOY] `rake db:migrate`
- [TODO DEPLOY] add the `FABLAB_WITHOUT_ONLINE_PAYMENT` environment variable (see [doc/environment.md](doc/environment.md) for configuration details)
- [TODO DEPLOY] -> (only dev) `rvm install ruby-2.3.8 && rvm use && bundle install`

View File

@ -35,7 +35,7 @@ class Members::MembersService
@member.invoicing_profile.first_name = params[:profile_attributes][:first_name]
@member.invoicing_profile.last_name = params[:profile_attributes][:last_name]
@member.statistic_profile.group_id = params[:group_id]
@member.statistic_profile.role_id = Role.find_by(name: 'member').id
@member.statistic_profile.role_id = Role.find_or_create_by!(name: 'member').id
if @member.save
@member.generate_subscription_invoice(current_user.id)