From b82bf879fd62c6543563d9716a61704ab269c9af Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Mon, 9 Sep 2013 17:03:33 +0200 Subject: [PATCH] fix records field: accept None as (old) value --- composer/schema/grid/field.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer/schema/grid/field.py b/composer/schema/grid/field.py index 2188d7e..78f57a2 100644 --- a/composer/schema/grid/field.py +++ b/composer/schema/grid/field.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2011 Helmut Merz helmutm@cy55.de +# Copyright (c) 2013 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -148,7 +148,7 @@ class RecordsFieldInstance(GridFieldInstance): if not value: value = [] result = [] - oldValue = getattr(self.clientContext, self.name, []) + oldValue = getattr(self.clientContext, self.name, None) or [] for idx, row in enumerate(value): item = self.unmarshallRow(row, idx) if item: