Commit d15030b9b10b80e9964740a9afb7bb673437ed15
1 parent
ba2af642
Exists in
master
and in
5 other branches
Environment admins are added to the institution when one is created via admin panel.
Signed-off-by: Parley Martins <parley@outlook.com> Signed-off-by: Gustavo Jaruga <darksshades@gmail.com>
Showing
1 changed file
with
5 additions
and
1 deletions
Show diff stats
controllers/mpog_software_plugin_controller.rb
... | ... | @@ -73,7 +73,11 @@ class MpogSoftwarePluginController < ApplicationController |
73 | 73 | end |
74 | 74 | |
75 | 75 | institution = private_create_institution() |
76 | - | |
76 | + if environment.admins.include?(current_user.person) | |
77 | + environment.admins.each do |adm| | |
78 | + institution.community.add_admin(adm) | |
79 | + end | |
80 | + end | |
77 | 81 | response_message = if institution.errors.full_messages.empty? and institution.valid? and institution.save |
78 | 82 | {:success => true, :message => _("Institution successful created!"), :institution_data=>{:name=>institution.name, :id=>institution.id}} |
79 | 83 | else | ... | ... |