simplifying code for list_folder function
@@ -3033,17 +3033,12 @@ class ResourceFile(ResourceFileIRODSMixin):
else:
file_folder_to_match = folder[len(resource.file_path) + 1:]
- if resource.is_federated:
if sub_folders:
+ if resource.is_federated:
return ResourceFile.objects.filter(
object_id=resource.id,
fed_resource_file__startswith=folder)
else:
- return ResourceFile.objects.filter(
- object_id=resource.id,
- file_folder=file_folder_to_match)
- else:
- if sub_folders:
return ResourceFile.objects.filter(
object_id=resource.id,
resource_file__startswith=folder)
