removing specific logical file type check for logical file main file
@@ -95,8 +95,7 @@ def data_store_structure(request):
folder_aggregation_type = aggregation_object.get_aggregation_class_name()
folder_aggregation_name = aggregation_object.get_aggregation_display_name()
folder_aggregation_id = aggregation_object.id
- if not aggregation_object.is_fileset and not aggregation_object.is_model_program and \
- not aggregation_object.is_model_instance:
+ if aggregation_object.get_main_file is not None:
main_file = aggregation_object.get_main_file.file_name
else:
# check first if ModelProgram/ModelInstance aggregation type can be created from this folder
@@ -107,9 +106,9 @@ def data_store_structure(request):
if can_set_model_instance and can_set_model_program:
folder_aggregation_type_to_set = 'ModelProgramOrInstanceLogicalFile'
elif can_set_model_program:
- folder_aggregation_type_to_set = 'ModelProgramLogicalFile'
+ folder_aggregation_type_to_set = ModelProgramLogicalFile.__name__
elif can_set_model_instance:
- folder_aggregation_type_to_set = 'ModelInstanceLogicalFile'
+ folder_aggregation_type_to_set = ModelInstanceLogicalFile.__name__
# otherwise, check if FileSet aggregation type that can be created from this folder
elif FileSetLogicalFile.can_set_folder_to_aggregation(resource=resource, dir_path=dir_path):
folder_aggregation_type_to_set = FileSetLogicalFile.__name__
