j2labs/dictshield — pull request #72 by nicolaiarocci (2012-03-15 16:02:56+00:00)
Title: Fixed a crash when raising a ShieldException upon validating 'choices' and 'validation' field arguments

The following would crash on m.validate():

from dictshield.document import Document
from dictshield.fields import StringField

class Media(Document):
title = StringField(choices=['choice1', 'choice2'])

def test():
m = Media()
m.title = 'nochance'
m.validate()

if __name__ == '__main__':
test()

The same crash would happen when defining a callable validation method for the field.