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

update dev database

parent 041b69ff
No related branches found
No related tags found
1 merge request!341SDC-1188 - final merge
Pipeline #72472 passed
......@@ -31,7 +31,7 @@
{% include 'taskdatabase/pagination.html' %}
</div>
</div>
<p class="footer"> Version 16 Feb 2024 (7:00)
<p class="footer"> Version 16 Feb 2024 (11:00)
</div>
{% include 'taskdatabase/refresh.html' %}
......
<!-- keep the old mechanism in comments to test/evaluate, remove later when it works -->
<!-- keep the old mechanism in comments to test/evaluate, remove later when it works
{% if task.sasid_is_verified %}
<a href="{% url 'task-validate-sasid' task.pk 'poor' 'validated' my_tasks.number %}" class="btn btn-danger btn-sm" role="button"><i class="fas fa-check"></i> P</a>
......@@ -16,7 +16,8 @@
<a href="{% url 'task-validate-sasid' task.pk 'calculated' 'validated' my_tasks.number %}" class="btn btn-success btn-sm" role="button"><i class="fas fa-check"></i> Validate</a>
{% endif %}
<!-- new activity mechanism, to enable SDC-1188
-->
<!-- new activity mechanism, to enable SDC-1188 -->
{% if task.activity.is_verified %}
<a href="{% url 'task-validate-sasid' task.pk 'poor' 'validated' my_tasks.number %}" class="btn btn-danger btn-sm" role="button"><i class="fas fa-check"></i> P</a>
{% endif %}
......@@ -32,4 +33,3 @@
{% if task.activity.is_verified %}
<a href="{% url 'task-validate-sasid' task.pk 'calculated' 'validated' my_tasks.number %}" class="btn btn-success btn-sm" role="button"><i class="fas fa-check"></i> Validate</a>
{% endif %}
-->
\ No newline at end of file
......@@ -133,6 +133,7 @@ urlpatterns = [
#some migration and repair endpoints
path('tasks/repair/associate-activities/', views.AssociateActivities, name='associate-activities'),
path('tasks/repair/update-all-activities/', views.UpdateAllActivities, name='update-all-activities'),
path('tasks/repair/update-activity/<sas_id>', views.UpdateActivitySasId, name='update-activity-sasid'),
path('tasks/repair/update-failed-tasks/', views.UpdateFailedTasks, name='update-failed-tasks'),
path('tasks/repair/update-ingestq-tasks/<batch_size>', views.UpdateIngestQTasks, name='update-ingestq-tasks'),
path('tasks/repair/update-finished-tasks/', views.UpdateFinishedTasks, name='update-finished-tasks'),
......
......@@ -9,6 +9,7 @@ from django.contrib import messages
from rest_framework import generics
from rest_framework.response import Response
from django.http import JsonResponse
from django_filters import rest_framework as filters
from django_filters.views import FilterView
......@@ -1728,6 +1729,33 @@ def UpdateAllActivities(request):
return redirect('index')
def UpdateActivitySasId(request, sas_id):
# this function is called externally to avoid worker timeouts
# http://localhost:8000/atdb/tasks/repair/update-activity/600907
try:
activity = Activity.objects.get(sas_id=sas_id)
tasks = Task.objects.filter(sas_id=activity.sas_id)
total = tasks.count()
i = 0
for task in tasks:
i += 1
activities_handler.update_activity(task)
logger.info(f'{i} of {total} for sas_id = {sas_id}')
logger.info(f'UpdateActivitySasId {sas_id}')
except Exception as error:
logger.error(error)
return JsonResponse({
'error': error
})
return JsonResponse({
'total': total
})
@staff_member_required
def UpdateFailedTasks(request):
......
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