From c5744e3306cd3f3c264c5d9c0178222fc4abf229 Mon Sep 17 00:00:00 2001 From: Arthur Del Esposte Date: Thu, 23 Apr 2015 11:55:17 +0000 Subject: [PATCH] Fix template creation considering GovUserPlugin --- lib/tasks/templates.rake | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/tasks/templates.rake b/lib/tasks/templates.rake index 9763045..3d90c1e 100644 --- a/lib/tasks/templates.rake +++ b/lib/tasks/templates.rake @@ -191,12 +191,14 @@ namespace :templates do person.save! puts "Person successfully created!" - institution_block = InstitutionsBlock.new - institution_block.position = 4 - institution_block.save! - box1.blocks << institution_block - box1.save! - puts "InstitutionBlock successfully added to person!" + if env.plugin_enabled?("GovUserPlugin") + institution_block = InstitutionsBlock.new + institution_block.position = 4 + institution_block.save! + box1.blocks << institution_block + box1.save! + puts "InstitutionBlock successfully added to person!" + end software_block = SoftwaresBlock.new software_block.position = 2 @@ -235,7 +237,7 @@ namespace :templates do desc "Create new templates of intitution" task :institution => :environment do Environment.all.each do |env| - if env.plugin_enabled?("MpogSoftware") or env.plugin_enabled?("SoftwareCommunitiesPlugin") + if env.plugin_enabled?("MpogSoftware") or env.plugin_enabled?("GovUserPlugin") community = Community.create!(:name => "institution", :is_template => true, :moderated_articles => true, :environment => env) community.layout_template = "leftbar" -- libgit2 0.21.2