Skip to content

Commit 4f8d7d4

Browse files
committed
removed debug and added fix to customize! method
1 parent 91f53c7 commit 4f8d7d4

2 files changed

Lines changed: 1 addition & 15 deletions

File tree

app/controllers/org_admin/template_customizations_controller.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,7 @@ def create
1313
@template = Template.find(params[:template_id])
1414
authorize(@template, :customize?)
1515

16-
puts "AUTH CHECK COMPLETE"
17-
1816
if @template.customize?(current_user.org)
19-
20-
puts "PASSED"
21-
2217
begin
2318
@customisation = @template.customize!(current_user.org)
2419
redirect_to org_admin_template_path(@customisation)
@@ -27,9 +22,6 @@ def create
2722
flash.now[:alert] = _('Unable to customize that template.')
2823
end
2924
else
30-
31-
puts "FAILED"
32-
3325
flash.now[:notice] = _('That template is not customizable.')
3426
end
3527
redirect_back(fallback_location: org_admin_templates_path)

app/models/template.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -418,13 +418,7 @@ def generate_version?
418418
# Determines whether or not a customization for the customizing_org passed
419419
# should be generated
420420
def customize?(customizing_org)
421-
422-
puts "Is an Org? #{customizing_org.is_a?(Org)} AND (Is a funder? #{org.funder?} OR is default? #{is_default})"
423-
424421
if customizing_org.is_a?(Org) && (org.funder? || is_default)
425-
426-
puts "Found existing customization? #{!Template.unarchived.exists?(customization_of: family_id, org: customizing_org)}"
427-
428422
return !Template.unarchived.exists?(customization_of: family_id,
429423
org: customizing_org)
430424
end
@@ -491,7 +485,7 @@ def customize!(customizing_org)
491485
raise ArgumentError, _('customize! requires an organisation target') unless customizing_org.is_a?(Org)
492486

493487
# Assume self has org associated
494-
raise ArgumentError, _('customize! requires a template from a funder') if !org.funder_only? && !is_default
488+
raise ArgumentError, _('customize! requires a template from a funder') if !org.funder? && !is_default
495489

496490
args = {
497491
attributes: {

0 commit comments

Comments
 (0)