Make syntax simpler
@@ -428,15 +428,17 @@ def copy_resource_files_and_AVUs(src_res_id, dest_res_id, set_to_private=False):
dest_files = os.path.join(tgt_res.root_path, 'data')
istorage.copyFiles(src_files, dest_files)
+ src_coll = src_res.root_path
+ tgt_coll = tgt_res.root_path
for avu_name in avu_list:
- value = istorage.getAVU(src_res.root_path, avu_name)
+ value = istorage.getAVU(src_coll, avu_name)
if avu_name == 'isPublic':
if set_to_private:
- istorage.setAVU(tgt_res.root_path, avu_name, 'False')
+ istorage.setAVU(tgt_coll, avu_name, 'False')
else:
- istorage.setAVU(tgt_res.root_path, avu_name, value)
+ istorage.setAVU(tgt_coll, avu_name, value)
else:
- istorage.setAVU(tgt_res.root_path, avu_name, value)
+ istorage.setAVU(tgt_coll, avu_name, value)
# link copied resource files to Django resource model
files = src_res.files.all()
