diff --git a/coldfront/core/allocation/views.py b/coldfront/core/allocation/views.py index 6b0f4ddf1b..b0066e7c48 100644 --- a/coldfront/core/allocation/views.py +++ b/coldfront/core/allocation/views.py @@ -506,6 +506,8 @@ def get_context_data(self, **kwargs): if filter_parameters: context["expand_accordion"] = "show" + else: + context["expand_accordion"] = "" context["filter_parameters"] = filter_parameters context["filter_parameters_with_order_by"] = filter_parameters_with_order_by @@ -563,10 +565,13 @@ def get_context_data(self, **kwargs): user_resources = get_user_resources(self.request.user) resources_form_default_quantities = {} + resources_form_descriptions = {} resources_form_label_texts = {} resources_with_eula = {} attr_names = ("quantity_default_value", "quantity_label", "eula") for resource in user_resources: + if resource.description: + resources_form_descriptions[resource.id] = resource.description for attr_name in attr_names: query = Q(resource_attribute_type__name=attr_name) if resource.resourceattribute_set.filter(query).exists(): @@ -579,6 +584,7 @@ def get_context_data(self, **kwargs): resources_with_eula[resource.id] = value context["resources_form_default_quantities"] = resources_form_default_quantities + context["resources_form_descriptions"] = resources_form_descriptions context["resources_form_label_texts"] = resources_form_label_texts context["resources_with_eula"] = resources_with_eula context["resources_with_accounts"] = list( @@ -664,11 +670,11 @@ def form_valid(self, form): # Automatically create slurm_specs AllocationAttribute alloc_attr_slurm_specs = AllocationAttributeType.objects.get(name="slurm_specs") - title = allocation_obj.project.title.replace(':', ';').replace("'s", '').replace("'", '') + title = allocation_obj.project.title.replace(":", ";").replace("'s", "").replace("'", "") AllocationAttribute.objects.get_or_create( allocation_attribute_type=alloc_attr_slurm_specs, allocation=allocation_obj, - value=f"Description='{title:.96}'" + value=f"Description='{title:.96}'", ) if ALLOCATION_ACCOUNT_ENABLED and allocation_account and resource_obj.name in ALLOCATION_ACCOUNT_MAPPING: diff --git a/coldfront/core/project/views.py b/coldfront/core/project/views.py index d0b93dc94a..d09e1be29d 100644 --- a/coldfront/core/project/views.py +++ b/coldfront/core/project/views.py @@ -342,6 +342,8 @@ def get_context_data(self, **kwargs): if filter_parameters: context["expand_accordion"] = "show" + else: + context["expand_accordion"] = "" context["filter_parameters"] = filter_parameters context["filter_parameters_with_order_by"] = filter_parameters_with_order_by @@ -484,6 +486,8 @@ def get_context_data(self, **kwargs): if filter_parameters: context["expand_accordion"] = "show" + else: + context["expand_accordion"] = "" context["filter_parameters"] = filter_parameters context["filter_parameters_with_order_by"] = filter_parameters_with_order_by diff --git a/uv.lock b/uv.lock index 5001929811..c76acbab83 100644 --- a/uv.lock +++ b/uv.lock @@ -1450,7 +1450,7 @@ wheels = [ [[package]] name = "slurm-rest-api-client" version = "0.0.1" -source = { git = "https://github.com/NYU-RTS/rts-slurm-python-sdk#d8a9597877ea85e01807e6e77c0006770f6698dd" } +source = { git = "https://github.com/NYU-RTS/rts-slurm-python-sdk#471f2711af57ed5a6b858b4e36e56e6388ed1bf4" } dependencies = [ { name = "attrs" }, { name = "httpx2" },