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
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
def _get_password(self): value = getattr(self, 'password') if value is not None: bc = BCipher() return bc.decrypt(value) return value
def get_repo_pwd(self): value = getattr(self, 'repo_pwd') if value is not None: bc = BCipher() return bc.decrypt(value) return value