Commit eac0df4107a3653d2ccd03136fecefa51e97898f
1 parent
e0712cb5
Exists in
master
and in
79 other branches
Create institution with default institution template
Showing
1 changed file
with
5 additions
and
0 deletions
Show diff stats
controllers/mpog_software_plugin_controller.rb
@@ -67,6 +67,11 @@ class MpogSoftwarePluginController < ApplicationController | @@ -67,6 +67,11 @@ class MpogSoftwarePluginController < ApplicationController | ||
67 | if !params[:community].nil? and !params[:institutions].nil? | 67 | if !params[:community].nil? and !params[:institutions].nil? |
68 | response_message = {} | 68 | response_message = {} |
69 | 69 | ||
70 | + institution_template = Community["institution"] | ||
71 | + if (!institution_template.blank? && institution_template.is_template) | ||
72 | + params[:community][:template_id] = institution_template.id unless params[:community].blank? | ||
73 | + end | ||
74 | + | ||
70 | institution = private_create_institution() | 75 | institution = private_create_institution() |
71 | 76 | ||
72 | response_message = if institution.errors.full_messages.empty? and institution.valid? and institution.save | 77 | response_message = if institution.errors.full_messages.empty? and institution.valid? and institution.save |