Skip to content

Commit

Permalink
chore(types): fix type check errors
Browse files Browse the repository at this point in the history
  • Loading branch information
deveaud-m committed Apr 4, 2024
1 parent ed20402 commit 22427ee
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions fossology/uploads.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def upload_file(
:raises FossologyApiError: if the REST call failed
:raises AuthorizationError: if the REST call is not authorized
"""
data = {
data: dict = {
"folderId": str(folder.id),
"uploadDescription": description,
"public": access_level.value
Expand All @@ -246,6 +246,7 @@ def upload_file(
"applyGlobal": apply_global,
"ignoreScm": ignore_scm,
"uploadType": "file",
"location": dict(),
}

headers = {}
Expand All @@ -271,14 +272,16 @@ def upload_file(
elif vcs or url or server:
if vcs:
data["location"] = vcs
print(data)
data["uploadType"] = headers["uploadType"] = "vcs"
data["uploadType"] = "vcs"
headers["uploadType"] = "vcs"
elif url:
data["location"] = url
data["uploadType"] = headers["uploadType"] = "url"
data["uploadType"] = "url"
headers["uploadType"] = "url"
elif server:
data["location"] = server
data["uploadType"] = headers["uploadType"] = "server"
data["uploadType"] = "server"
headers["uploadType"] = "server"
headers["Content-Type"] = "application/json"
response = self.session.post(
endpoint,
Expand Down

0 comments on commit 22427ee

Please sign in to comment.