From c8256e579ea1a9e840619e1dade8f18353db7973 Mon Sep 17 00:00:00 2001 From: melinath Date: Wed, 16 Jun 2010 10:51:27 -0400 Subject: [PATCH] Made referencing containers optional on pages. Fixes a bug. --- admin.py | 2 ++ models.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/admin.py b/admin.py index 0744e0b..1566c5b 100644 --- a/admin.py +++ b/admin.py @@ -231,6 +231,8 @@ class PageAdmin(EntityAdmin): for container_name, container_content_type in contentreference_containers: if ('contentreference_container_%s' % container_name) in form.cleaned_data: content = form.cleaned_data[('contentreference_container_%s' % container_name)] + if content == None: + continue contentreference, created = page.contentreferences.get_or_create(name=container_name, defaults={'content': content}) if not created: contentreference.content = content diff --git a/models.py b/models.py index 26de321..9210e1b 100644 --- a/models.py +++ b/models.py @@ -125,7 +125,7 @@ class CollectionMember(models.Model): member = generic.GenericForeignKey('member_content_type', 'member_object_id') def __unicode__(self): - return '%s - %s' % (self.collection, self.member) + return u'%s - %s' % (self.collection, self.member) class TreeManager(models.Manager): -- 2.20.1