Raise KeyError when Record.__getitem__ is called with a unknown field name

issue7073
review44591002
This commit is contained in:
C?dric Krier 2018-01-23 22:18:15 +01:00
parent 9213e59cc2
commit 75c5d1938f

View file

@ -131,7 +131,7 @@ class Record(SignalEvent):
for key in record.modified_fields:
value.pop(key, None)
record.set(value, signal=False)
return self.group.fields.get(name, False)
return self.group.fields[name]
def __repr__(self):
return '<Record %s@%s at %s>' % (self.id, self.model_name, id(self))