From 70e781489493f6d84febf2f235e84971f959154d Mon Sep 17 00:00:00 2001 From: shim_ <> Date: Thu, 4 Oct 2018 17:05:50 +0200 Subject: [PATCH] address double slash issue --- imports/seafapi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imports/seafapi.py b/imports/seafapi.py index b05a2c4..944b6ce 100644 --- a/imports/seafapi.py +++ b/imports/seafapi.py @@ -12,7 +12,7 @@ class SeafileClient: self.login = (username,password) def api_endpoint(self): - return "%s/api2/" % self.server + return "%s/api2" % self.server def ping(self,auth=False): try: @@ -24,7 +24,7 @@ class SeafileClient: def obtain_token(self): user,passw = self.login try: - req=self.session.post("%s/auth-token/" % self.api_endpoint(), data = {'username': user, 'password': passw }) + req=requests.post("%s/auth-token/" % self.api_endpoint(), data = {'username': user, 'password': passw }) json = req.json() if "non_field_errors" in json: print(json["non_field_errors"])