Changeset 67 for trunk/db/fields.py


Ignore:
Timestamp:
06/23/08 23:59:46 (6 years ago)
Author:
msaelices
Message:

Now we find out if value is already encrypted. Fixes #43.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/db/fields.py

    r66 r67  
    2020from cmsutils.oldforms.fields import SpanishDateField as oldformsSpanishDateField 
    2121from cmsutils.map_utils import MapPosition 
    22 from cmsutils.utils import encrypt, decrypt 
     22from cmsutils.utils import encrypt, decrypt, is_encrypted 
    2323 
    2424 
     
    376376 
    377377    def get_db_prep_save(self, value): 
    378         value = self._encrypt(value) 
     378        if not is_encrypted(value): 
     379            # value is yet encrypted (for example if it came from fixtures) 
     380            value = self._encrypt(value) 
    379381        return super(EncryptedField, self).get_db_prep_save(value) 
    380382 
Note: See TracChangeset for help on using the changeset viewer.