Skip to content

Commit

Permalink
Merge pull request #328 from fasrc/cp_sfpathcheck
Browse files Browse the repository at this point in the history
fine-tune allocation matching
  • Loading branch information
claire-peters authored Aug 22, 2024
2 parents 91972b8 + 124f961 commit 9634063
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion coldfront/core/utils/fasrc.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def select_one_project_allocation(project_obj, resource_obj, dirpath):
resource_obj
dirpath
"""
filter_vals = {'resources__id': resource_obj.id}
filter_vals = {'resources__id': resource_obj.id, "status__name__in": ['Active', 'Pending Deactivation']}
allocation_query = project_obj.allocation_set.filter(**filter_vals)
if allocation_query.count() < 1:
return None
Expand All @@ -73,6 +73,8 @@ def select_one_project_allocation(project_obj, resource_obj, dirpath):
if len(allocations) == 1:
return allocations[0]
elif len(allocations) > 1:
print(allocations)
logger.exception('multiple allocations found for project/resource/path pairing: %s', allocations)
raise Exception('multiple allocations found for project/resource/path pairing')

def determine_size_fmt(byte_num):
Expand Down

0 comments on commit 9634063

Please sign in to comment.