svetlyak40wt/django-fields — pull request #34 by defrex (2013-07-09 20:11:41+00:00)
Title: Enable reusing fields with a `block_type` specified

It seems the newer code paths with `block_type` specified can't reuse the cipher object on the field class. `to_python` was already redefining it before decrypting the value, but `get_db_prep_value` wasn't before encrypting.

The result was that the first time you used a model it would be fine, but the second would fail. Thus the tests were passing but the classes were functionally useless in an application.