simplify logic for removing aggregation for a resource file
@@ -81,16 +81,12 @@ class CompositeResource(BaseResource):
:param src_folder: folder from which the file got moved from
:param tgt_folder: folder to which the file got moved into
"""
- if moved_res_file.has_logical_file and (moved_res_file.logical_file.is_fileset or
- moved_res_file.logical_file.is_model_program or
- moved_res_file.logical_file.is_model_instance):
+
if moved_res_file.file_folder:
try:
aggregation = self.get_aggregation_by_name(moved_res_file.file_folder)
+ # aggregation must be one of 'fileset', modelinstance' or 'modelprogram
if aggregation == moved_res_file.logical_file:
- if aggregation.is_fileset or ((aggregation.is_model_program or
- aggregation.is_model_instance) and
- aggregation.folder is not None):
# remove aggregation association with the file
# the removed aggregation is a fileset aggregation or a model program or a model instance
# aggregation based on folder (note: model program/instance aggregation can also be
