Fix bug causing random project names when hide project names enabled

This commit is contained in:
Alan Hamlett 2019-01-05 14:00:37 +07:00
parent 60b696858a
commit 8afc6133cf
4 changed files with 40 additions and 1 deletions

View file

@ -335,7 +335,7 @@ def boolean_or_list(config_name, args, configs, alternative_names=[]):
"""Get a boolean or list of regexes from args and configs."""
# when argument flag present, set to wildcard regex
for key in alternative_names:
for key in alternative_names + [config_name]:
if hasattr(args, key) and getattr(args, key):
setattr(args, config_name, ['.*'])
return

View file

@ -69,6 +69,8 @@ def get_project_info(configs, heartbeat, data):
project_name = data.get('project') or heartbeat.args.project
hide_project = heartbeat.should_obfuscate_project()
if hide_project and project_name is not None:
return project_name, None
if project_name is None or branch_name is None: