Skip to content

Commit

Permalink
Fix product creation
Browse files Browse the repository at this point in the history
Force collectstatic
  • Loading branch information
aaronk committed Nov 2, 2023
1 parent bcd10af commit 3b34e1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions coldfront/plugins/ifx/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion container_startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &

Expand Down

0 comments on commit 3b34e1f

Please sign in to comment.