Add flags in admin from for cypress_reset_view
This commit is contained in:
parent
1196aba79d
commit
b48ab5ec3d
|
|
@ -134,7 +134,28 @@ def check_rate_limit(request):
|
||||||
@permission_classes((IsAdminUser,))
|
@permission_classes((IsAdminUser,))
|
||||||
def cypress_reset_view(request):
|
def cypress_reset_view(request):
|
||||||
if not settings.APP_ENVIRONMENT.startswith("prod"):
|
if not settings.APP_ENVIRONMENT.startswith("prod"):
|
||||||
call_command("cypress_reset")
|
# Checking for the flags in the POST request
|
||||||
|
create_assignment_completion = request.data.get(
|
||||||
|
'create_assignment_completion') == 'true'
|
||||||
|
create_assignment_evaluation = request.data.get(
|
||||||
|
'create_assignment_evaluation') == 'true'
|
||||||
|
create_edoniq_test_results = request.data.get(
|
||||||
|
'create_edoniq_test_results') == 'true'
|
||||||
|
|
||||||
|
# TODO: Handle the flags as needed. For example:
|
||||||
|
if create_assignment_completion:
|
||||||
|
# Logic for creating assignment completion
|
||||||
|
pass
|
||||||
|
if create_edoniq_test_results:
|
||||||
|
# Logic for creating Edoniq test results
|
||||||
|
pass
|
||||||
|
|
||||||
|
call_command(
|
||||||
|
"cypress_reset",
|
||||||
|
create_assignment_completion=create_assignment_completion,
|
||||||
|
create_assignment_evaluation=create_assignment_evaluation,
|
||||||
|
create_edoniq_test_results=create_edoniq_test_results,
|
||||||
|
)
|
||||||
|
|
||||||
return HttpResponseRedirect("/server/admin/")
|
return HttpResponseRedirect("/server/admin/")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,49 +1,71 @@
|
||||||
{% extends "admin/index.html" %}
|
{% extends "admin/index.html" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div id="content-main">
|
<div id="content-main">
|
||||||
{% include "admin/app_list.html" with app_list=app_list show_changelinks=True %}
|
{% include "admin/app_list.html" with app_list=app_list show_changelinks=True %}
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<h1>üK</h1>
|
<h1>üK</h1>
|
||||||
<h1>Excel Import üK</h1>
|
<h1>Excel Import üK</h1>
|
||||||
<h2>Durchführungen und Trainer</h2>
|
<h2>Durchführungen und Trainer</h2>
|
||||||
<form method="post" enctype="multipart/form-data" action="/server/importer/coursesession-trainer-import/">
|
<form method="post" enctype="multipart/form-data"
|
||||||
|
action="/server/importer/coursesession-trainer-import/">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<input type="file" name="excel_file" accept=".xlsx, .xls">
|
<input type="file" name="excel_file" accept=".xlsx, .xls">
|
||||||
<input type="submit" value="Durchführungen und Trainer importieren">
|
<input type="submit" value="Durchführungen und Trainer importieren">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<h2>Teilnehmer</h2>
|
<h2>Teilnehmer</h2>
|
||||||
<form method="post" enctype="multipart/form-data" action="/server/importer/coursesession-students-import/">
|
<form method="post" enctype="multipart/form-data"
|
||||||
|
action="/server/importer/coursesession-students-import/">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<input type="file" name="excel_file" accept=".xlsx, .xls">
|
<input type="file" name="excel_file" accept=".xlsx, .xls">
|
||||||
<input type="submit" value="Teilnehmer importieren">
|
<input type="submit" value="Teilnehmer importieren">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<h2>Sync mit T2L Daten</h2>
|
<h2>Sync mit T2L Daten</h2>
|
||||||
<form method="post" enctype="multipart/form-data" action="/server/importer/t2l-sync/">
|
<form method="post" enctype="multipart/form-data"
|
||||||
|
action="/server/importer/t2l-sync/">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<input type="file" name="excel_file" accept=".xlsx, .xls">
|
<input type="file" name="excel_file" accept=".xlsx, .xls">
|
||||||
<input type="submit" value="Teilnehmer mit T2L-Daten Synchronisiern">
|
<input type="submit" value="Teilnehmer mit T2L-Daten Synchronisiern">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<h2>Export Edoniq Teilnehmer</h2>
|
<h2>Export Edoniq Teilnehmer</h2>
|
||||||
<a href="{% url 'edoniq_export_students' %}" class="btn btn-primary">Teilnehmer exportieren</a>
|
<a href="{% url 'edoniq_export_students' %}" class="btn btn-primary">Teilnehmer
|
||||||
|
exportieren</a>
|
||||||
|
|
||||||
<h2>Export Edoniq Trainer</h2>
|
<h2>Export Edoniq Trainer</h2>
|
||||||
<a href="{% url 'edoniq_export_trainers' %}" class="btn btn-primary">Trainer exportieren</a>
|
<a href="{% url 'edoniq_export_trainers' %}" class="btn btn-primary">Trainer
|
||||||
|
exportieren</a>
|
||||||
|
|
||||||
<h2>Export Edoniq Teilnehmer und Trainer</h2>
|
<h2>Export Edoniq Teilnehmer und Trainer</h2>
|
||||||
<a href="{% url 'edoniq_export_students_and_trainers' %}" class="btn btn-primary">Teilnehmer und Trainer exportieren</a>
|
<a href="{% url 'edoniq_export_students_and_trainers' %}" class="btn btn-primary">Teilnehmer
|
||||||
|
und Trainer exportieren</a>
|
||||||
|
|
||||||
|
<hr style="margin: 24px 0">
|
||||||
|
|
||||||
<h1>Reset</h1>
|
|
||||||
<form action="/api/core/cypressreset/" method="post">
|
<form action="/api/core/cypressreset/" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<button class="btn" name="">Testdaten zurück setzen</button>
|
<label>
|
||||||
|
<input type="checkbox" name="create_assignment_completion" value="true">
|
||||||
|
create_assignment_completion
|
||||||
|
</label>
|
||||||
|
<div style="margin: 8px"></div>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="create_assignment_evaluation" value="true">
|
||||||
|
create_assignment_evaluation
|
||||||
|
</label>
|
||||||
|
<div style="margin: 8px"></div>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" name="create_edoniq_test_results" value="true">
|
||||||
|
create_edoniq_test_results
|
||||||
|
</label>
|
||||||
|
<div style="margin: 8px"></div>
|
||||||
|
<button class="btn">Testdaten zurück setzen</button>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue