diff --git a/coldfront/core/allocation/views.py b/coldfront/core/allocation/views.py index c3ca0948c..2ba7012a8 100644 --- a/coldfront/core/allocation/views.py +++ b/coldfront/core/allocation/views.py @@ -2027,6 +2027,7 @@ def post(self, request, *args, **kwargs): # require nese shares to be divisible by 20 if formset_data['name'] == 'Storage Quota (TB)': try: + new_value = re.sub('\.0$', '', new_value) tbs = int(new_value) except ValueError: messages.error(request, 'Requested storage quota must be an integer.') diff --git a/coldfront/plugins/sftocf/tasks.py b/coldfront/plugins/sftocf/tasks.py index d82f58a0f..e725ec13a 100644 --- a/coldfront/plugins/sftocf/tasks.py +++ b/coldfront/plugins/sftocf/tasks.py @@ -4,6 +4,8 @@ def pull_sf_push_cf(): management.call_command('pull_sf_push_cf') +def update_zones(): + management.call_command('update_zones') def pull_resource_data(): utils.pull_resource_data() diff --git a/coldfront/plugins/sftocf/utils.py b/coldfront/plugins/sftocf/utils.py index c974abb89..c8f1a095a 100644 --- a/coldfront/plugins/sftocf/utils.py +++ b/coldfront/plugins/sftocf/utils.py @@ -571,11 +571,12 @@ def __init__(self, volume=None): if volume: self.volumes = [volume] else: - self.volumes = self.connection_obj.get_corresponding_coldfront_resources() + resources = self.connection_obj.get_corresponding_coldfront_resources() + self.volumes = [r.name.split('/')[0] for r in resources] self.allocations = Allocation.objects.filter( status__name__in=['Active', 'New', 'Updated', 'Ready for Review'], - resources__in=self.volumes + resources__in=resources ) # self.collection_filter = self.set_collection_parameters() self.sf_user_data = self.collect_sf_user_data() @@ -973,8 +974,11 @@ def pull_resource_data(source='rest_api'): res_attr_types = ResourceAttributeType.objects.all() for volume in volumes: - resource = Resource.objects.get(name__contains=volume['name']) - + try: + resource = Resource.objects.get(name__contains=volume['name']) + except Exception as e: + logger.error("error encountered with pull_resource_data resource location: %s", e) + continue for attr_name, attr_val in volume['attrs'].items(): if attr_val: attr_type_obj = res_attr_types.get(name=attr_name)