Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
kdp-cloud committed Oct 10, 2024
1 parent 8ba55a2 commit 50c3df4
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions app/controllers/sample_types_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,6 @@ def update
end
end

def check_isa_json_compliance
@sample_type ||= SampleType.find(params[:id])
if Seek::Config.isa_json_compliance_enabled && @sample_type.is_isa_json_compliant?
flash[:error] = 'This sample type is ISA JSON compliant and cannot be managed.'
redirect_to sample_types_path
end
end

def template_details
render partial: 'template'
end
Expand Down Expand Up @@ -189,7 +181,13 @@ def build_sample_type_from_template
@sample_type.build_attributes_from_template
end

private
def check_isa_json_compliance
@sample_type ||= SampleType.find(params[:id])
return unless Seek::Config.isa_json_compliance_enabled && @sample_type.is_isa_json_compliant?

flash[:error] = 'This sample type is ISA JSON compliant and cannot be managed.'
redirect_to sample_types_path
end

def find_sample_type
scope = Seek::Config.isa_json_compliance_enabled ? SampleType.without_template : SampleType
Expand Down

0 comments on commit 50c3df4

Please sign in to comment.