Skip to content

Commit

Permalink
[9.0][FIX] server_environment - pylint error fix
Browse files Browse the repository at this point in the history
  • Loading branch information
baimont committed Dec 16, 2019
1 parent 10b39e3 commit 0b7e7b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server_environment/serv_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,14 @@ def fields_view_get(self, cr, uid, view_id=None, view_type='form',
return res

@api.model
def _is_secret(self, key):
def _is_secret(self, cr, uid, key=None, context=None):
"""
This method is intended to be inherited to defined which keywords
should be secret.
:return: list of secret keywords
"""
if key is None:
key = []
secret_keys = ['passw', 'key', 'secret', 'token']
return any(secret_key in key for secret_key in secret_keys)

Expand All @@ -265,7 +267,7 @@ def default_get(self, cr, uid, fields_list, context=None):
return res
for key in self._conf_defaults:
if not self.show_passwords and self._is_secret(
cr, uid, context=context, key=key):
cr, uid, key=key, context=context):
res[key] = '**********'
else:
res[key] = self._conf_defaults[key]()
Expand Down

0 comments on commit 0b7e7b6

Please sign in to comment.