feat: Add timestamps to instance health check

This commit is contained in:
moanos [he/him] 2024-10-19 19:46:11 +02:00
parent 1282b6b201
commit 6844e771b5
2 changed files with 28 additions and 2 deletions

View File

@ -24,6 +24,28 @@
<p>{% translate "Texte scheinen vollständig" %}</p> <p>{% translate "Texte scheinen vollständig" %}</p>
{% endif %} {% endif %}
<h2>{% trans "Zeitstempel" %}</h2>
{% if timestamps|length > 0 %}
<p>
<table>
<tr>
<th>{% translate "Key" %}</th>
<th>{% translate "Zeitstempel" %}</th>
<th>{% translate "Daten" %}</th>
</tr>
{% for timestamp in timestamps %}
<tr>
<td>{{ timestamp.key }}</td>
<td>{{ timestamp.timestamp }}</td>
<td>{{ timestamp.data }}</td>
</tr>
{% endfor %}
</table>
</p>
{% else %}
<p>{% translate "Keine Zeitstempel geloggt." %}</p>
{% endif %}
<h2>{% translate "Nicht-lokalisierte Vermittlungen" %}</h2> <h2>{% translate "Nicht-lokalisierte Vermittlungen" %}</h2>
{% if number_not_geocoded_adoption_notices > 0 %} {% if number_not_geocoded_adoption_notices > 0 %}
<details> <details>

View File

@ -14,7 +14,7 @@ from notfellchen import settings
from fellchensammlung import logger from fellchensammlung import logger
from .models import AdoptionNotice, Text, Animal, Rule, Image, Report, ModerationAction, \ from .models import AdoptionNotice, Text, Animal, Rule, Image, Report, ModerationAction, \
User, Location, AdoptionNoticeStatus, Subscriptions, CommentNotification, BaseNotification, RescueOrganization, \ User, Location, AdoptionNoticeStatus, Subscriptions, CommentNotification, BaseNotification, RescueOrganization, \
Species, Log Species, Log, Timestamp
from .forms import AdoptionNoticeForm, AdoptionNoticeFormWithDateWidget, ImageForm, ReportAdoptionNoticeForm, \ from .forms import AdoptionNoticeForm, AdoptionNoticeFormWithDateWidget, ImageForm, ReportAdoptionNoticeForm, \
CommentForm, ReportCommentForm, AnimalForm, \ CommentForm, ReportCommentForm, AnimalForm, \
AdoptionNoticeSearchForm, AnimalFormWithDateWidget, AdoptionNoticeFormWithDateWidgetAutoAnimal AdoptionNoticeSearchForm, AnimalFormWithDateWidget, AdoptionNoticeFormWithDateWidgetAutoAnimal
@ -522,6 +522,9 @@ def instance_health_check(request):
except Text.DoesNotExist: except Text.DoesNotExist:
missing_texts.append((text_code, language)) missing_texts.append((text_code, language))
# Timestamps
timestamps = Timestamp.objects.all()
context = { context = {
"number_of_adoption_notices": number_of_adoption_notices, "number_of_adoption_notices": number_of_adoption_notices,
"number_not_geocoded_adoption_notices": number_not_geocoded_adoption_notices, "number_not_geocoded_adoption_notices": number_not_geocoded_adoption_notices,
@ -531,7 +534,8 @@ def instance_health_check(request):
"none_geocoded_rescue_orgs": none_geocoded_rescue_orgs, "none_geocoded_rescue_orgs": none_geocoded_rescue_orgs,
"missing_texts": missing_texts, "missing_texts": missing_texts,
"number_unchecked_ans": number_unchecked_ans, "number_unchecked_ans": number_unchecked_ans,
"unchecked_ans": unchecked_ans "unchecked_ans": unchecked_ans,
"timestamps": timestamps
} }
return render(request, 'fellchensammlung/instance-health-check.html', context=context) return render(request, 'fellchensammlung/instance-health-check.html', context=context)