Repository: kartoza/prj.app

Issue:
Sponsorship end date is redundant
Since we already have the end data as a calc of start date + duration we don't need the end date field.



Discussion:

Resolving patch:
diff --git a/django_project/changes/forms.py b/django_project/changes/forms.py
--- a/django_project/changes/forms.py
+++ b/django_project/changes/forms.py
@@ -142,9 +142,8 @@ class Meta:
             'sponsor_url',
             'contact_person',
             'sponsor_email',
-            'sponsor_duration',
             'start_date',
-            'end_date',
+            'sponsor_duration',
             'sponsorshiplevel',
             'agreement',
             'logo'
@@ -162,9 +161,8 @@ def __init__(self, *args, **kwargs):
                 Field('sponsor_url', css_class="form-control"),
                 Field('contact_person', css_class="form-control"),
                 Field('sponsor_email', css_class="form-control"),
-                Field('sponsor_duration', css_class="form-control"),
                 Field('start_date', css_class="form-control"),
-                Field('end_date', css_class="form-control"),
+                Field('sponsor_duration', css_class="form-control"),
                 Field('sponsorshiplevel', css_class="form-control"),
                 Field('agreement', css_class="form-control"),
                 Field('logo', css_class="form-control"),
diff --git a/django_project/changes/migrations/0001_initial.py b/django_project/changes/migrations/0001_initial.py
--- a/django_project/changes/migrations/0001_initial.py
+++ b/django_project/changes/migrations/0001_initial.py
@@ -10,8 +10,8 @@
 class Migration(migrations.Migration):
 
     dependencies = [
-        ('base', '0001_initial'),
         migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+        ('base', '0001_initial'),
     ]
 
     operations = [
@@ -57,8 +57,7 @@ class Migration(migrations.Migration):
                 ('contact_person', models.CharField(help_text=b'Input the contact person of sponsor.', max_length=255, null=True, blank=True)),
                 ('sponsor_email', models.CharField(help_text=b'Input an email of sponsor.', max_length=255, null=True, blank=True)),
                 ('sponsor_duration', models.CharField(help_text=b'Input the sponsor duration (in months).', max_length=20, null=True, blank=True)),
-                ('start_date', models.DateTimeField(default=datetime.datetime(2015, 11, 13, 17, 9, 38, 461208), verbose_name='Start date')),
-                ('end_date', models.DateTimeField(default=datetime.datetime(2015, 11, 13, 17, 9, 38, 461300), verbose_name='End date')),
+                ('start_date', models.DateTimeField(default=datetime.datetime(2015, 12, 8, 0, 32, 11, 695415), verbose_name='Start date')),
                 ('agreement', models.FileField(help_text=b'Attach sponsor agreement', upload_to=b'docs', blank=True)),
                 ('logo', models.ImageField(help_text=b'An image of sponsor logo e.g. a splashscreen. Most browsers support dragging the image directly on to the "Choose File" button above.', upload_to=b'images/projects')),
                 ('approved', models.BooleanField(default=False, help_text='Whether this sponsor has been approved for use by the project owner.')),
@@ -82,8 +81,8 @@ class Migration(migrations.Migration):
             name='SponsorshipPeriod',
             fields=[
                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
-                ('start_date', models.DateField(default=datetime.date(2015, 11, 13), verbose_name='Start date')),
-                ('end_date', models.DateField(default=datetime.date(2015, 11, 13), verbose_name='End date')),
+                ('start_date', models.DateField(default=datetime.date(2015, 12, 8), verbose_name='Start date')),
+                ('end_date', models.DateField(default=datetime.date(2015, 12, 8), verbose_name='End date')),
                 ('sponsor', models.ForeignKey(to='changes.Sponsor')),
             ],
         ),
diff --git a/django_project/changes/models/sponsor.py b/django_project/changes/models/sponsor.py
--- a/django_project/changes/models/sponsor.py
+++ b/django_project/changes/models/sponsor.py
@@ -75,10 +75,6 @@ class Sponsor(models.Model):
         _("Start date"),
         default=datetime.datetime.today())
 
-    end_date = models.DateTimeField(
-        _("End date"),
-        default=datetime.datetime.today())
-
     agreement = models.FileField(
         help_text=('Attach sponsor agreement'),
         upload_to=os.path.join(MEDIA_ROOT, 'docs'),


Test patch: