From 3b34e1f74c92d648947ce71cffceba0f21460d3b Mon Sep 17 00:00:00 2001 From: Aaron Kitzmiller Date: Thu, 2 Nov 2023 10:55:10 -0400 Subject: [PATCH] Fix product creation Force collectstatic --- coldfront/plugins/ifx/models.py | 5 +++-- container_startup.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/coldfront/plugins/ifx/models.py b/coldfront/plugins/ifx/models.py index 6da48207a..1c0fd6d82 100644 --- a/coldfront/plugins/ifx/models.py +++ b/coldfront/plugins/ifx/models.py @@ -136,12 +136,13 @@ def resource_post_save(sender, instance, **kwargs): except ProductResource.DoesNotExist: # Need to create a Product and ProductResource for this Resource products = FiineAPI.listProducts(product_name=instance.name) + facility = Facility.objects.get(name='Research Computing Storage') if not products: - facility = Facility.objects.get(name='Research Computing Storage') product = create_new_product(product_name=instance.name, product_description=instance.name, facility=facility) else: fiine_product = products[0].to_dict() - fiine_product.pop('facility') + fiine_product.pop('object_code_category') + fiine_product['facility'] = facility fiine_product['billing_calculator'] = 'coldfront.plugins.ifx.calculator.NewColdfrontBillingCalculator' (product, created) = Product.objects.get_or_create(**fiine_product) product_resource = ProductResource.objects.create(product=product, resource=instance) diff --git a/container_startup.sh b/container_startup.sh index 6e2f289de..78668d236 100644 --- a/container_startup.sh +++ b/container_startup.sh @@ -9,7 +9,7 @@ service redis-server start python ./manage.py qcluster & python ./manage.py add_scheduled_tasks -python ./manage.py collectstatic +python ./manage.py collectstatic --noinput # initial_setup does not appear to work as requested. python ./manage.py initial_setup &