delete single file aggregation deletes associated xml files
@@ -1064,6 +1064,14 @@ class AbstractLogicalFile(models.Model):
"""
from hs_core.hydroshare.resource import delete_resource_file
+
+ # delete associated metadata and map xml documents
+ istorage = self.resource.get_irods_storage()
+ if istorage.exists(self.metadata_file_path):
+ istorage.delete(self.metadata_file_path)
+ if istorage.exists(self.map_file_path):
+ istorage.delete(self.map_file_path)
+
# delete all resource files associated with this instance of logical file
if delete_res_files:
for f in self.files.all():
