From 971ac3a4c7154984765979f52f02431d2b002b64 Mon Sep 17 00:00:00 2001
From: Arnaud Fabre <arnaud.fabre@camobscura.fr>
Date: Tue, 16 Jun 2015 14:49:54 +0200
Subject: [PATCH] bug fixes

---
 .../migrations/0002_auto_20150616_1249.py     | 50 +++++++++++++++++++
 representatives_votes/models.py               | 12 ++---
 2 files changed, 56 insertions(+), 6 deletions(-)
 create mode 100644 representatives_votes/migrations/0002_auto_20150616_1249.py

diff --git a/representatives_votes/migrations/0002_auto_20150616_1249.py b/representatives_votes/migrations/0002_auto_20150616_1249.py
new file mode 100644
index 0000000..af0e50f
--- /dev/null
+++ b/representatives_votes/migrations/0002_auto_20150616_1249.py
@@ -0,0 +1,50 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('representatives_votes', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='dossier',
+            name='text',
+            field=models.TextField(default=b'', blank=True),
+            preserve_default=True,
+        ),
+        migrations.AlterField(
+            model_name='proposal',
+            name='description',
+            field=models.TextField(default=b'', blank=True),
+            preserve_default=True,
+        ),
+        migrations.AlterField(
+            model_name='proposal',
+            name='kind',
+            field=models.CharField(default=b'', max_length=200, blank=True),
+            preserve_default=True,
+        ),
+        migrations.AlterField(
+            model_name='proposal',
+            name='reference',
+            field=models.CharField(max_length=200, null=True, blank=True),
+            preserve_default=True,
+        ),
+        migrations.AlterField(
+            model_name='vote',
+            name='representative_name',
+            field=models.CharField(max_length=200, null=True, blank=True),
+            preserve_default=True,
+        ),
+        migrations.AlterField(
+            model_name='vote',
+            name='representative_remote_id',
+            field=models.CharField(max_length=200, null=True, blank=True),
+            preserve_default=True,
+        ),
+    ]
diff --git a/representatives_votes/models.py b/representatives_votes/models.py
index fbaaa1d..0768ef2 100644
--- a/representatives_votes/models.py
+++ b/representatives_votes/models.py
@@ -22,17 +22,17 @@ from django.db import models
 class Dossier(models.Model):
     title = models.CharField(max_length=1000)
     reference = models.CharField(max_length=200)
-    text = models.TextField(blank=True)
+    text = models.TextField(blank=True, default='')
     link = models.URLField()
 
 
 class Proposal(models.Model):
     dossier = models.ForeignKey(Dossier, related_name='proposals')
     title = models.CharField(max_length=1000)
-    description = models.TextField(blank=True)
-    reference = models.CharField(max_length=200, blank=True)
+    description = models.TextField(blank=True, default='')
+    reference = models.CharField(max_length=200, blank=True, null=True)
     datetime = models.DateTimeField()
-    kind = models.CharField(max_length=200, blank=True)
+    kind = models.CharField(max_length=200, blank=True, default='')
     total_abstain = models.IntegerField()
     total_against = models.IntegerField()
     total_for = models.IntegerField()
@@ -56,7 +56,7 @@ class Vote(models.Model):
     proposal = models.ForeignKey(Proposal, related_name='votes')
 
     # There are two representative fields for flexibility,
-    representative_name = models.CharField(max_length=200, blank=True)
-    representative_remote_id = models.CharField(max_length=200, blank=True)
+    representative_name = models.CharField(max_length=200, blank=True, null=True)
+    representative_remote_id = models.CharField(max_length=200, blank=True, null=True)
 
     position = models.CharField(max_length=10, choices=VOTECHOICES)
-- 
GitLab