Patchwork Don't require optional model fields in forms

login
register
mail settings
Submitter Dirk Wallenstein
Date Jan. 15, 2011, 11:52 a.m.
Message ID <1295092327-15376-1-git-send-email-halsmit@t-online.de>
Download mbox | patch
Permalink /patch/79051/
State Superseded
Headers show

Comments

Dirk Wallenstein - Jan. 15, 2011, 11:52 a.m.
The keyword 'blank' concerns only validation and does not change what
will be stored in the database.

Signed-off-by: Dirk Wallenstein <halsmit@t-online.de>
---
 apps/patchwork/models.py |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

Patch

diff --git a/apps/patchwork/models.py b/apps/patchwork/models.py
index 5c0ca95..3989694 100644
--- a/apps/patchwork/models.py
+++ b/apps/patchwork/models.py
@@ -44,8 +44,8 @@  except ImportError:
 
 class Person(models.Model):
     email = models.CharField(max_length=255, unique = True)
-    name = models.CharField(max_length=255, null = True)
-    user = models.ForeignKey(User, null = True)
+    name = models.CharField(max_length=255, null=True, blank=True)
+    user = models.ForeignKey(User, null=True, blank=True)
 
     def __unicode__(self):
         if self.name:
@@ -71,7 +71,7 @@  class Project(models.Model):
 
 class UserProfile(models.Model):
     user = models.ForeignKey(User, unique = True)
-    primary_project = models.ForeignKey(Project, null = True)
+    primary_project = models.ForeignKey(Project, null=True, blank=True)
     maintainer_projects = models.ManyToManyField(Project,
             related_name = 'maintainer_project')
     send_email = models.BooleanField(default = False,
@@ -189,7 +189,7 @@  class Patch(models.Model):
     archived = models.BooleanField(default = False)
     headers = models.TextField(blank = True)
     content = models.TextField(null = True)
-    pull_url = models.CharField(max_length=255, null = True)
+    pull_url = models.CharField(max_length=255, null=True, blank=True)
     commit_ref = models.CharField(max_length=255, null = True, blank = True)
     hash = HashField(null = True, db_index = True)