Exemple #1
0
 def get_prep_value(self, value):
     if value is not None and value != '':
         bc = BCipher()
         enc = bc.encrypt(value)
     else:
         enc = value
     return enc
Exemple #2
0
 def pre_save(self, model_instance, add):
     cleartext = getattr(model_instance, self.attname)
     key = getattr(settings, 'SECRET_KEY')
     bc = BCipher(key)
     enc = bc.encrypt(cleartext)
     setattr(model_instance, self.attname, enc)
     return enc
Exemple #3
0
 def _set_password(self, clear_text):
     bc = BCipher()
     setattr(self, 'password', bc.encrypt(clear_text))
Exemple #4
0
 def set_repo_pwd(self, clear_text):
     bc = BCipher()
     setattr(self, 'repo_pwd', bc.encrypt(clear_text))