Athorize empty questions
This commit is contained in:
parent
f64e64f11d
commit
fe8152ab09
4 changed files with 38 additions and 3 deletions
23
elections/migrations/0027_auto_20210614_1123.py
Normal file
23
elections/migrations/0027_auto_20210614_1123.py
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# Generated by Django 3.2.4 on 2021-06-14 09:23
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("elections", "0026_auto_20210529_2246"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="question",
|
||||||
|
name="text_en",
|
||||||
|
field=models.TextField(blank=True, default="", verbose_name="question"),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="question",
|
||||||
|
name="text_fr",
|
||||||
|
field=models.TextField(blank=True, default="", verbose_name="question"),
|
||||||
|
),
|
||||||
|
]
|
|
@ -81,7 +81,9 @@ class Question(models.Model):
|
||||||
election = models.ForeignKey(
|
election = models.ForeignKey(
|
||||||
Election, related_name="questions", on_delete=models.CASCADE
|
Election, related_name="questions", on_delete=models.CASCADE
|
||||||
)
|
)
|
||||||
text = TranslatedFieldWithFallback(models.TextField(_("question"), blank=False))
|
text = TranslatedFieldWithFallback(
|
||||||
|
models.TextField(_("question"), blank=True, default="")
|
||||||
|
)
|
||||||
type = models.CharField(
|
type = models.CharField(
|
||||||
_("type de question"),
|
_("type de question"),
|
||||||
choices=QUESTION_TYPES,
|
choices=QUESTION_TYPES,
|
||||||
|
|
|
@ -181,7 +181,12 @@
|
||||||
<div class="panel-heading is-size-6">
|
<div class="panel-heading is-size-6">
|
||||||
<div class="level">
|
<div class="level">
|
||||||
<div class="level-left is-flex-shrink-1">
|
<div class="level-left is-flex-shrink-1">
|
||||||
<span>{{ q }}</span>
|
<span class="icon-text">
|
||||||
|
<span class="icon">
|
||||||
|
<i class="fas fa-poll-h"></i>
|
||||||
|
</span>
|
||||||
|
<span>{{ q }}</span>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if q in cast_questions %}
|
{% if q in cast_questions %}
|
||||||
|
|
|
@ -195,7 +195,12 @@
|
||||||
<div class="level">
|
<div class="level">
|
||||||
<div class="level-left is-flex-shrink-1">
|
<div class="level-left is-flex-shrink-1">
|
||||||
<div class="level-item is-flex-shrink-1">
|
<div class="level-item is-flex-shrink-1">
|
||||||
<span>{{ q }}</span>
|
<span class="icon-text">
|
||||||
|
<span class="icon">
|
||||||
|
<i class="fas fa-poll-h"></i>
|
||||||
|
</span>
|
||||||
|
<span>{{ q }}</span>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if election.start_date > current_time %}
|
{% if election.start_date > current_time %}
|
||||||
|
|
Loading…
Reference in a new issue