1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +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
parent 0ace42bda9
commit f1958a300b
2 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
# Changelog Fab Manager
- Fix a bug: unable to create the first user because role member was missing
- Ability to configure and export the accounting data to the ACD accounting software
- [TODO DEPLOY] `rake db:migrate`

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)