Unverified Commit 5e6c4d21 authored by Gautier D's avatar Gautier D Committed by Florent Chehab
Browse files

fix(backend): add button for newly created cron task for stats

parent 394329be
......@@ -22,4 +22,10 @@
<br />
<input type="submit" name="cron_name" value="clear_and_clean_sessions" />
</form>
<form method="post">
{% csrf_token %}
<br />
<input type="submit" name="cron_name" value="update_daily_stats" />
</form>
{% endblock %}
......@@ -9,7 +9,13 @@ from backend_app.utils import clean_route
from backend_app.viewsets import ALL_VIEWSETS
from base_app.forms import UserForm
from base_app.models import User
from _cron_tasks import update_currencies, update_utc_ent, update_extra_denormalization, clear_and_clean_sessions
from _cron_tasks import (
update_currencies,
update_utc_ent,
update_extra_denormalization,
clear_and_clean_sessions,
update_daily_stats,
)
logger = logging.getLogger("django")
......@@ -111,6 +117,8 @@ def trigger_cron(request):
update_extra_denormalization()
elif cron_task == "clear_and_clean_sessions":
clear_and_clean_sessions()
elif cron_task == "update_daily_stats":
update_daily_stats()
else:
return HttpResponseNotFound()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment