...
This commit is contained in:
@@ -49,6 +49,8 @@ class LabelAdmin(PermissionsAdminMixin, admin.ModelAdmin):
|
||||
@admin.register(SubmittedQuestion)
|
||||
class SubmittedQuestionAdmin(admin.ModelAdmin):
|
||||
list_filter = [ActiveFilter,]
|
||||
list_display = ['__str__', 'release']
|
||||
list_editable = ['release',]
|
||||
|
||||
|
||||
@admin.register(Question)
|
||||
|
||||
@@ -94,6 +94,7 @@ def release_submitted(sender, instance: SubmittedQuestion, **kwargs):
|
||||
buzzword=instance.buzzword,
|
||||
question=instance.question,
|
||||
awnser=instance.awnser,
|
||||
is_published=True,
|
||||
)
|
||||
try:
|
||||
n.labels.set(instance.labels.all())
|
||||
|
||||
@@ -34,11 +34,18 @@
|
||||
}
|
||||
</style>
|
||||
{% if messages %}
|
||||
<ul class="messages">
|
||||
<div class="messages">
|
||||
{% for message in messages %}
|
||||
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
|
||||
<div{% if message.tags %} class="alert alert-{{ message.tags }} alert-dismissible fade show"{% endif %} onclick="$(this).fadeOut('slow');">
|
||||
{{ message }}
|
||||
<!--
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
-->
|
||||
</div>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="form_wrapper">
|
||||
<form method="post" action="?">
|
||||
|
||||
@@ -51,7 +51,7 @@ def submit_question(request):
|
||||
question=form.cleaned_data['question'],
|
||||
awnser=form.cleaned_data['awnser'],
|
||||
)
|
||||
messages.info(request, f"Angelegt mit ID {subq.id}")
|
||||
messages.info(request, f"Die Frage wurde eingereicht")
|
||||
return render(request, 'submit-question.html', {'form': SubmitQuestion()})
|
||||
else:
|
||||
[messages.error(request,f'Error in {err}') for err in form.errors]
|
||||
|
||||
Reference in New Issue
Block a user