Reset AssignmentCompletion data on reset action

This commit is contained in:
Daniel Egger 2023-05-08 13:51:53 +02:00
parent d2f916bc79
commit edc1eed60d
3 changed files with 3 additions and 5 deletions

View File

@ -1,5 +1,6 @@
import djclick as click
from vbv_lernwelt.assignment.models import AssignmentCompletion
from vbv_lernwelt.core.models import User
from vbv_lernwelt.course.models import CourseCompletion
from vbv_lernwelt.notify.models import Notification
@ -10,4 +11,5 @@ def command():
print("cypress reset data")
CourseCompletion.objects.all().delete()
Notification.objects.all().delete()
AssignmentCompletion.objects.all().delete()
User.objects.all().update(language="de")

View File

@ -142,7 +142,7 @@ def cypress_reset_view(request):
if settings.APP_ENVIRONMENT != "production":
call_command("cypress_reset")
return HttpResponseRedirect("/admin/")
return HttpResponseRedirect("/server/admin/")
@django_view_authentication_exempt

View File

@ -9,10 +9,6 @@
{% csrf_token %}
<button class="btn" name="">Testdaten zurück setzen</button>
</form>
<form action="/api/core/schemareset/" method="post">
{% csrf_token %}
<button class="btn" name="">Datenbank zurück setzen</button>
</form>
</div>
</div>