Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nvuillam committed Jun 29, 2024
1 parent 79be1e2 commit 85732a3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions megalinter/reporters/ApiReporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,11 @@ def send_to_api(self):
if config.exists(
self.master.request_id, "API_REPORTER_BEARER_TOKEN"
) or config.exists(self.master.request_id, "NOTIF_API_BEARER_TOKEN"):
headers["Authorization"] = (
f"Bearer {config.get_first_var_set(self.master.request_id, ["API_REPORTER_BEARER_TOKEN","NOTIF_API_BEARER_TOKEN"])}"
bearer = config.get_first_var_set(
self.master.request_id,
["API_REPORTER_BEARER_TOKEN", "NOTIF_API_BEARER_TOKEN"],
)
headers["Authorization"] = f"Bearer {bearer}"
try:
response = session.post(
self.api_url, headers=headers, json=self.payloadFormatted
Expand Down Expand Up @@ -300,9 +302,11 @@ def send_to_metrics_api(self):
if config.exists(
self.master.request_id, "API_REPORTER_METRICS_BEARER_TOKEN"
) or config.exists(self.master.request_id, "NOTIF_API_METRICS_BEARER_TOKEN"):
headers["Authorization"] = (
f"Bearer {config.get_first_var_set(self.master.request_id, ["API_REPORTER_METRICS_BEARER_TOKEN","NOTIF_API_METRICS_BEARER_TOKEN"])}"
bearer = config.get_first_var_set(
self.master.request_id,
["API_REPORTER_METRICS_BEARER_TOKEN", "NOTIF_API_METRICS_BEARER_TOKEN"],
)
headers["Authorization"] = f"Bearer {bearer}"
try:
response = session.post(
self.api_url, headers=headers, json=self.payloadFormatted
Expand Down

0 comments on commit 85732a3

Please sign in to comment.