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

Merge branch 'hack-on-hold-when-stored' into 'master'

task goes 'on hold' when status goes to 'stored'

See merge request !283
parents 1ab5a2a3 ba716f1a
No related branches found
No related tags found
1 merge request!283task goes 'on hold' when status goes to 'stored'
Pipeline #44998 passed
...@@ -105,6 +105,16 @@ class Task(models.Model): ...@@ -105,6 +105,16 @@ class Task(models.Model):
def __str__(self): def __str__(self):
return str(self.id) + ' - (' + self.task_type + ') - ' + str(self.sas_id) return str(self.id) + ' - (' + self.task_type + ') - ' + str(self.sas_id)
def save(self, *args, **kwargs):
# nv:1mar2023, temporary hack, set tasks 'on hold' as soon they get to 'stored'
# (users forget to do that manually, causing unwanted ingests)
if (self.status != 'stored') & (self.new_status == 'stored'):
self.resume = False
super(Task, self).save(*args, **kwargs)
# this translates a view-name (from urls.py) back to a url, to avoid hardcoded url's in the html templates # this translates a view-name (from urls.py) back to a url, to avoid hardcoded url's in the html templates
# bad : <td><a href="/atdb/tasks/{{ task.id }}/" target="_blank">{{ task.taskID }} </a> </td> # bad : <td><a href="/atdb/tasks/{{ task.id }}/" target="_blank">{{ task.taskID }} </a> </td>
# good: <td><a href="{{ task.get_absolute_url }}" target="_blank">{{ task.taskID }} </a> </td> # good: <td><a href="{{ task.get_absolute_url }}" target="_blank">{{ task.taskID }} </a> </td>
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
{% include 'taskdatabase/pagination.html' %} {% include 'taskdatabase/pagination.html' %}
</div> </div>
</div> </div>
<p class="footer"> Version 27 Februari 2023 <p class="footer"> Version 1 March 2023
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment