diff --git a/coldfront/core/allocation/models.py b/coldfront/core/allocation/models.py index 00213feca..ecc0c0b33 100644 --- a/coldfront/core/allocation/models.py +++ b/coldfront/core/allocation/models.py @@ -58,6 +58,14 @@ class Meta: 'Can review allocation requests'), ('can_manage_invoice', 'Can manage invoice'), ) + + def valid_description(self): + if(str(description).isEmpty() == True or description == None): + print("hiii"+str(description)) + return False + else: + print("hiii"+str(description)) + return True def clean(self): if self.status.name == 'Expired': @@ -122,6 +130,8 @@ def get_information(self): percent ) html_string += string + if len(self.description) > 0 : + return self.description return mark_safe(html_string) diff --git a/coldfront/core/project/templates/project/project_detail.html b/coldfront/core/project/templates/project/project_detail.html index c5cc5ba51..eca559cdc 100644 --- a/coldfront/core/project/templates/project/project_detail.html +++ b/coldfront/core/project/templates/project/project_detail.html @@ -181,11 +181,7 @@

Allocation {{ allocation.get_parent_resource.name }} {{ allocation.get_parent_resource.resource_type.name }} - {% if allocation.description != None %} - {{allocation.description}} - {% else %} {{allocation.get_information}} - {% endif %} {% if allocation.status.name == 'Active' %} {{ allocation.status.name }} {% elif allocation.status.name == 'Expired' or allocation.status.name == 'Denied' %}