Skip to content
Snippets Groups Projects
Commit 6bf0e7d7 authored by Nico Vermaas's avatar Nico Vermaas
Browse files

bugfix: show SAS_ID (output)

parent 960f3725
No related branches found
No related tags found
1 merge request!334updates after demo to SDCO
Pipeline #68920 passed
...@@ -280,16 +280,38 @@ class Task(models.Model): ...@@ -280,16 +280,38 @@ class Task(models.Model):
@property @property
def sas_id_archived(self): def sas_id_archived(self):
"""
check if this task already has an output SAS_ID at the LTA
"""
try: try:
return self.archive['sas_id_archived'] return self.archive['sas_id_archived']
except: except:
return None return None
@property
def sas_id_has_archived(self):
"""
check if any task belonging to this sas_id already has an output SAS_ID at the LTA
"""
try:
for task in Task.objects.filter(sas_id=self.sas_id):
if task.archive['sas_id_archived']:
return task.archive['sas_id_archived']
except:
return None
@property @property
def path_to_lta(self): def path_to_lta(self):
"""
check if any task belonging to this sas_id already has a 'path_to_lta' setting
"""
try: try:
return self.archive['path_to_lta'] for task in Task.objects.filter(sas_id=self.sas_id):
if task.archive['path_to_lta']:
try:
return task.archive['path_to_lta']
except:
pass
except: except:
return None return None
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
{% include 'taskdatabase/pagination.html' %} {% include 'taskdatabase/pagination.html' %}
</div> </div>
</div> </div>
<p class="footer"> Version 12 Jan 2024 <p class="footer"> Version 15 Jan 2024
</div> </div>
{% include 'taskdatabase/refresh.html' %} {% include 'taskdatabase/refresh.html' %}
......
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
<td>{{ task.sasid_ingested_fraction.completion }}%</td> <td>{{ task.sasid_ingested_fraction.completion }}%</td>
<td> <td>
{% if task.sas_id_archived != None %} {% if task.sas_id_has_archived != None %}
<a href={{ task.path_to_lta }} target="_blank"> <a href={{ task.path_to_lta }} target="_blank">
<img src="{% static 'taskdatabase/ldvlogo_small.png' %}" height="20" alt="link to LTA"> <img src="{% static 'taskdatabase/ldvlogo_small.png' %}" height="20" alt="link to LTA">
{{ task.sas_id_archived }} {{ task.sas_id_has_archived }}
</a>&nbsp; </a>&nbsp;
{% else %} {% else %}
- -
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment