From 3d98bc90cda94e9a51b49fa71a0b05b70139e507 Mon Sep 17 00:00:00 2001 From: chawki Date: Tue, 10 Oct 2017 19:02:31 +0100 Subject: [PATCH] #304 - Create a date for start accepting proposals --- .../0018_event_accept_proposals_at.py | 20 +++++++++++++++++++ deck/models.py | 2 ++ deck/tests/test_unit.py | 3 +++ 3 files changed, 25 insertions(+) create mode 100644 deck/migrations/0018_event_accept_proposals_at.py diff --git a/deck/migrations/0018_event_accept_proposals_at.py b/deck/migrations/0018_event_accept_proposals_at.py new file mode 100644 index 0000000..d0fd469 --- /dev/null +++ b/deck/migrations/0018_event_accept_proposals_at.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.5 on 2017-10-10 17:59 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('deck', '0017_auto_20170922_1704'), + ] + + operations = [ + migrations.AddField( + model_name='event', + name='accept_proposals_at', + field=models.DateTimeField(blank=True, null=True), + ), + ] diff --git a/deck/models.py b/deck/models.py index b440ffb..7079bee 100644 --- a/deck/models.py +++ b/deck/models.py @@ -285,6 +285,8 @@ class Event(DeckBaseModel): anonymous_voting = models.BooleanField( _('Anonymous Voting?'), default=False) + accept_proposals_at = models.DateTimeField(null=True, blank=True) + class Meta: ordering = ['-due_date', '-created_at'] verbose_name = _('Event') diff --git a/deck/tests/test_unit.py b/deck/tests/test_unit.py index 79e8eb2..a3e92be 100644 --- a/deck/tests/test_unit.py +++ b/deck/tests/test_unit.py @@ -125,6 +125,9 @@ def test_assert_event_jury_should_not_be_required(self): def test_assert_event_jury_should_have_a_related_name(self): self.assertEquals('event', self.fields['jury'].rel.related_name) + def test_assert_event_date_accept_proposals_should_not_be_required(self): + self.assertEquals(True, self.fields['accept_proposals_at'].null) + self.assertEquals(True, self.fields['accept_proposals_at'].blank) class EventObjectTest(TestCase): def setUp(self):