Skip to content
Snippets Groups Projects
Commit 60ee176e authored by jan.bednarik's avatar jan.bednarik
Browse files

Add flag is_draft to Report.

parent 40e4023d
No related branches found
No related tags found
No related merge requests found
......@@ -33,4 +33,5 @@ class ReportDoc(DocType):
fields = [
'date',
'published',
'is_draft',
]
# Generated by Django 2.0.2 on 2018-02-25 22:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0010_user_has_colliding_name'),
]
operations = [
migrations.AddField(
model_name='report',
name='is_draft',
field=models.BooleanField(default=False),
),
]
......@@ -64,6 +64,7 @@ class Report(models.Model):
our_participants = models.TextField(null=True, blank=True)
other_participants = models.TextField(null=True, blank=True)
extra = JSONField(null=True, blank=True)
is_draft = models.BooleanField(default=False)
def save(self, *args, **kwargs):
super().save(*args, **kwargs)
......
......@@ -34,6 +34,7 @@ def test_report__is_saved_in_elasticsearch():
our_participants='me',
other_participants='them',
extra={'a': 3},
is_draft=False,
)
docs = list(ReportDoc.search())
assert len(docs) == 1
......@@ -49,6 +50,7 @@ def test_report__is_saved_in_elasticsearch():
assert doc.our_participants == 'me'
assert doc.other_participants == 'them'
assert doc.extra == {'a': 3}
assert doc.is_draft is False
def test_report__save_works_with_no_extra():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment