Skip to content

Commit

Permalink
Fixing statis analysis in fetch_upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Ponni-M committed Apr 18, 2021
1 parent 7cf1000 commit 943a894
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions zulip/zulip/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def get_user_agent(self) -> str:
)

def do_api_query(self, orig_request: Mapping[str, Any], url: str, method: str = "POST",
longpolling: bool = False, files: Optional[List[IO[Any]]] = None, timeout: Optional[float] = None,
longpolling: bool = False, files: Optional[List[IO[Any]]] = None, timeout: Optional[float] = None,
accesswithAPI: bool = True) -> Dict[str, Any]:
if files is None:
files = []
Expand Down Expand Up @@ -527,7 +527,7 @@ def end_error_retry(succeeded: bool) -> None:
if accesswithAPI:
if not api_url.endswith(API_STRING):
api_url += API_STRING
api_url += "/"
api_url += "/"
else:
if api_url.endswith(API_STRING):
api_url = api_url[:-len(API_STRING)]
Expand Down Expand Up @@ -608,7 +608,7 @@ def end_error_retry(succeeded: bool) -> None:
"status_code": res.status_code}

def call_endpoint(self, url: Optional[str] = None, method: str = "POST", request: Optional[Dict[str, Any]] = None,
longpolling: bool = False, files: Optional[List[IO[Any]]] = None, timeout: Optional[float] = None,
longpolling: bool = False, files: Optional[List[IO[Any]]] = None, timeout: Optional[float] = None,
accessVersionedAPI: bool = True) -> Dict[str, Any]:
if request is None:
request = dict()
Expand Down Expand Up @@ -754,10 +754,9 @@ def fetch_upload(self) -> Dict[str, Any]:
'''
See examples/upload-file for example usage.
'''

return self.call_endpoint(
url='user_uploads',
method = 'GET',
method = 'GET',
accessVersionedAPI = False
)

Expand Down

0 comments on commit 943a894

Please sign in to comment.