p = getattr(self, "preview_html_%s" % lang)
assert p
return p
- except AssertionError:
+ except (AssertionError, AttributeError):
return self.preview_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)
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)