fix records field: accept None as (old) value

This commit is contained in:
Helmut Merz 2013-09-09 17:03:33 +02:00
parent 8cbe50a90b
commit b82bf879fd

View file

@ -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 # 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 # it under the terms of the GNU General Public License as published by
@ -148,7 +148,7 @@ class RecordsFieldInstance(GridFieldInstance):
if not value: if not value:
value = [] value = []
result = [] result = []
oldValue = getattr(self.clientContext, self.name, []) oldValue = getattr(self.clientContext, self.name, None) or []
for idx, row in enumerate(value): for idx, row in enumerate(value):
item = self.unmarshallRow(row, idx) item = self.unmarshallRow(row, idx)
if item: if item: