diff --git a/src/vr/__init__.py b/src/vr/__init__.py index 90fe1b0..e184511 100644 --- a/src/vr/__init__.py +++ b/src/vr/__init__.py @@ -218,7 +218,7 @@ def getPersistentConfig(): sql = 'SELECT * FROM AppConfig WHERE 1=1' cur.execute(sql) row = cur.fetchone() - if row[2]: + if row and row[2]: app.config['APP_EXT_URL'] = row[3] app.config['AUTH_TYPE'] = row[4] app.config['AZAD_AUTHORITY'] = row[5] diff --git a/src/vr/api/vulns/jenkins_webhook.py b/src/vr/api/vulns/jenkins_webhook.py index 0b2e8b2..f5698ae 100644 --- a/src/vr/api/vulns/jenkins_webhook.py +++ b/src/vr/api/vulns/jenkins_webhook.py @@ -219,14 +219,14 @@ def add_new_scan(git_url, branch_name, report_id): "Content-Type": "application/x-www-form-urlencoded" } data = { - 'token': JENKINS_TOKEN, + 'token': app.config['JENKINS_TOKEN'], 'GIT_URL': git_url, 'TESTS': stage_str, 'GIT_BRANCH': branch_name, 'REPORT_ID': report_id } - url = f'{JENKINS_HOST}/job/{JENKINS_PROJECT}/buildWithParameters' - resp = requests.post(url, headers=headers, data=data, auth=HTTPBasicAuth(JENKINS_USER, JENKINS_KEY)) + url = f"{app.config['JENKINS_HOST']}/job/{app.config['JENKINS_PROJECT']}/buildWithParameters" + resp = requests.post(url, headers=headers, data=data, auth=HTTPBasicAuth(app.config['JENKINS_USER'], app.config['JENKINS_KEY'])) response = jsonify({"Status": resp.status_code}), 200 except requests.exceptions.Timeout: print('Processing Error')