Skip to content

Commit

Permalink
This commit solves issue ubccr#193
Browse files Browse the repository at this point in the history
  • Loading branch information
bhatiadheeraj committed Dec 8, 2020
1 parent 29c1b0e commit be4793e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 10 additions & 0 deletions coldfront/core/allocation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -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)

Expand Down
4 changes: 0 additions & 4 deletions coldfront/core/project/templates/project/project_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,7 @@ <h3 class="d-inline"><i class="fas fa-server" aria-hidden="true"></i> Allocation
<tr>
<td>{{ allocation.get_parent_resource.name }}</td>
<td>{{ allocation.get_parent_resource.resource_type.name }}</td>
{% if allocation.description != None %}
<td class="text-nowrap">{{allocation.description}}</td>
{% else %}
<td class="text-nowrap">{{allocation.get_information}}</td>
{% endif %}
{% if allocation.status.name == 'Active' %}
<td class="text-success">{{ allocation.status.name }}</td>
{% elif allocation.status.name == 'Expired' or allocation.status.name == 'Denied' %}
Expand Down

0 comments on commit be4793e

Please sign in to comment.