예제 #1
0
 def to_python(self, value):
     value = super(CryptField, self).to_python(value)
     if value is not None:
         key = getattr(settings, 'SECRET_KEY')
         bc = BCipher(key)
         return bc.decrypt(value)
     return value
예제 #2
0
 def to_python(self, value):
     value = super(CryptField, self).to_python(value)
     if value is not None and value != '':
         bc = BCipher()
         return bc.decrypt(value)
     return value
예제 #3
0
 def _get_password(self):
     value = getattr(self, 'password')
     if value is not None:
         bc = BCipher()
         return bc.decrypt(value)
     return value
예제 #4
0
파일: models.py 프로젝트: dahool/vertaal
 def get_repo_pwd(self):
     value = getattr(self, 'repo_pwd')
     if value is not None:
         bc = BCipher()
         return bc.decrypt(value)
     return value