validate cover extension server-side
[redakcja.git] / apps / organizations / models.py
index 6a7aa7a..8e04ddb 100644 (file)
@@ -71,7 +71,7 @@ class Card(models.Model):
 
     def get_projects(self):
         for project_line in self.projects.strip().split('\n'):
 
     def get_projects(self):
         for project_line in self.projects.strip().split('\n'):
-            parts = project_line.strip().split(' ', 2)
+            parts = project_line.strip().split(None, 2)
             if not parts or not parts[0]:
                 continue
             url, lang, desc = (parts + [''] * 2)[:3]
             if not parts or not parts[0]:
                 continue
             url, lang, desc = (parts + [''] * 2)[:3]
@@ -90,7 +90,7 @@ class Card(models.Model):
 @python_2_unicode_compatible
 class UserCard(Card):
     preview_html_template = 'organizations/snippets/user.html'
 @python_2_unicode_compatible
 class UserCard(Card):
     preview_html_template = 'organizations/snippets/user.html'
-    user = models.ForeignKey(User, unique=True, primary_key=True)
+    user = models.OneToOneField(User, primary_key=True)
 
     def __str__(self):
         return str(self.user)
 
     def __str__(self):
         return str(self.user)
@@ -104,7 +104,7 @@ class Organization(Card):
     preview_html_template = 'organizations/snippets/organization.html'
 
     name = models.CharField(max_length=1024)
     preview_html_template = 'organizations/snippets/organization.html'
 
     name = models.CharField(max_length=1024)
-    tags = models.ManyToManyField('catalogue.Tag')
+    tags = models.ManyToManyField('catalogue.Tag', blank=True)
     # logo = models.ImageField(upload_to='people/logo', blank=True)
     # country = models.CharField(max_length=64, blank=True, choices=countries)
     # www = models.URLField(blank=True)
     # logo = models.ImageField(upload_to='people/logo', blank=True)
     # country = models.CharField(max_length=64, blank=True, choices=countries)
     # www = models.URLField(blank=True)