diff --git a/atdb/taskdatabase/models.py b/atdb/taskdatabase/models.py index deed3c942cf2e810246911a58788d10f1fa870ea..f1b3bd958655ddfae5b59188595452c1ba342891 100644 --- a/atdb/taskdatabase/models.py +++ b/atdb/taskdatabase/models.py @@ -105,6 +105,16 @@ class Task(models.Model): def __str__(self): 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 # 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> diff --git a/atdb/taskdatabase/templates/taskdatabase/index.html b/atdb/taskdatabase/templates/taskdatabase/index.html index eb4a14eff8546bae67e72a51dec9eebbbfb78a66..28aae03a0b259f9b120d6874032734cb3808b22c 100644 --- a/atdb/taskdatabase/templates/taskdatabase/index.html +++ b/atdb/taskdatabase/templates/taskdatabase/index.html @@ -34,7 +34,7 @@ {% include 'taskdatabase/pagination.html' %} </div> </div> - <p class="footer"> Version 27 Februari 2023 + <p class="footer"> Version 1 March 2023 </div>