Skip to content

Commit

Permalink
Renamed the setting for the encrypted field keys directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanOC authored and trbs committed Jan 18, 2010
1 parent 459276d commit ec31d92
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions django_extensions/db/fields/encrypted.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
class BaseEncryptedField(models.Field):
prefix = 'enc_str:::'
def __init__(self, *args, **kwargs):
if not hasattr(settings, 'KEYS_DIR'):
raise ImproperlyConfigured('You must set settings.KEYS_DIR to your Keyczar keys directory.')
self.crypt = keyczar.Crypter.Read(settings.KEYS_DIR)
if not hasattr(settings, 'ENCRYPTED_FIELD_KEY_DIR'):
raise ImproperlyConfigured('You must set settings.ENCRYPTED_FIELD_KEY_DIR to your Keyczar keys directory.')
self.crypt = keyczar.Crypter.Read(settings.ENCRYPTED_FIELD_KEY_DIR)
super(BaseEncryptedField, self).__init__(*args, **kwargs)

def to_python(self, value):
Expand Down Expand Up @@ -45,7 +45,6 @@ def __init__(self, max_length=None, *args, **kwargs):

super(EncryptedCharField, self).__init__(max_length=max_length, *args, **kwargs)


def get_internal_type(self):
return "CharField"

Expand Down

0 comments on commit ec31d92

Please sign in to comment.