changes to show that the logic accounts for model program and model instance
@@ -646,22 +646,22 @@ class CompositeResource(BaseResource):
"""checks if the target folder allows file/folder move action"""
tgt_aggr_path = tgt_file_dir[len(self.file_path) + 1:]
- # check if this move would create a nested model program aggregation - nested model program aggregation
- # is not allowed
+ # check if this move would create a nested model program/instance aggregation -
+ # nested model program/instance aggregation is not allowed
if src_aggr is not None and src_aggr.is_model_program:
if is_moving_file or is_moving_folder:
- src_mp_aggr = src_aggr
- # find if there is any model program aggregation in the target path
- tgt_mp_aggr = self.get_model_aggregation_in_path(tgt_aggr_path)
- if tgt_mp_aggr is not None:
- if src_mp_aggr.folder is None:
+ src_model_aggr = src_aggr
+ # find if there is any model program.instance aggregation in the target path
+ tgt_model_aggr = self.get_model_aggregation_in_path(tgt_aggr_path)
+ if tgt_model_aggr is not None:
+ if src_model_aggr.folder is None:
# file/folder being moved is part of a model aggregation - we can't move that
- # into a folder based model program aggregation as it will result in nested
- # model program aggregations
+ # into a folder based model program/instance aggregation as it will result in nested
+ # model program/instance aggregations
return False
# check if the move is within the same aggregation folder hierarchy - allow the move
- return tgt_mp_aggr.folder == src_mp_aggr.folder
+ return tgt_model_aggr.folder == src_model_aggr.folder
# target folder is either a normal folder or fileset folder - file or folder move is allowed
return True
