From 5b1c2ce0c9ae16eb13cd84e6c522698f56e28bf4 Mon Sep 17 00:00:00 2001 From: Holger Sielaff Date: Sat, 21 Sep 2024 12:33:00 +0200 Subject: [PATCH] ... --- content/admin.py | 2 ++ content/models.py | 1 + content/templates/submit-question.html | 13 ++++++++++--- content/views/public.py | 2 +- templates/base.html | 1 + 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/content/admin.py b/content/admin.py index 61995d2..38ff7b1 100644 --- a/content/admin.py +++ b/content/admin.py @@ -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) diff --git a/content/models.py b/content/models.py index f53871a..537bb9d 100644 --- a/content/models.py +++ b/content/models.py @@ -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()) diff --git a/content/templates/submit-question.html b/content/templates/submit-question.html index e0a22d6..d350e0f 100644 --- a/content/templates/submit-question.html +++ b/content/templates/submit-question.html @@ -34,11 +34,18 @@ } {% if messages %} - + {% endif %}
diff --git a/content/views/public.py b/content/views/public.py index 9325591..05a7bcc 100644 --- a/content/views/public.py +++ b/content/views/public.py @@ -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] diff --git a/templates/base.html b/templates/base.html index c2ff1c0..4b05f94 100644 --- a/templates/base.html +++ b/templates/base.html @@ -5,6 +5,7 @@ TablequizDB +