defrex/django-encrypted-fields

ValueError: zero length field name in format

Opened this issue · 1 comments

Getting error:
File "/home/idbill/workspace/OPT/venv/pyvenv/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 979, in as_sql
val = field.get_db_prep_save(val, connection=self.connection)
File "/home/idbill/workspace/OPT/venv/pyvenv/lib/python2.6/site-packages/django/db/models/fields/init.py", line 304, in get_db_prep_save
prepared=False)
File "/home/idbill/workspace/OPT/venv/pyvenv/lib/python2.6/site-packages/encrypted_fields/fields.py", line 194, in get_db_prep_value
len(value),
ValueError: zero length field name in format

Appears the following:
'Field {} max_length={} encrypted_len={}'.format(
self.name,
self.max_length,
len(value),

needs to be:
'Field {0} max_length={1} encrypted_len={2}'.format(
self.name,
self.max_length,
len(value),

as per:
http://stackoverflow.com/questions/20941386/django-manage-py-returns-valueerror-zero-length-field-name-in-format

Ya, {} only works in Python 2.7+.