diff options
author | Kanagaraj Manickam <kanagaraj.manickam@huawei.com> | 2020-10-20 07:34:42 +0530 |
---|---|---|
committer | Kanagaraj Manickam <kanagaraj.manickam@huawei.com> | 2020-10-20 08:03:14 +0530 |
commit | 7a13dabbedff1184c12e3e4f5cf56545f1d01397 (patch) | |
tree | 34015d87f75173bc8b880bef5de6a67711d7bf24 /opnfv_testapi/ui | |
parent | dd4334b75ca4da1941711cd7b7f3c9e702f1d6fe (diff) |
Fix the format issuesHEADopnfv-10.0.0stable/jermamaster
Issue-ID: DOVETAIL-801
Signed-off-by: Kanagaraj Manickam <kanagaraj.manickam@huawei.com>
Change-Id: Id0058788d8d2d8fb8a1fa0a7c43fc3c1731d73df
Diffstat (limited to 'opnfv_testapi/ui')
-rw-r--r-- | opnfv_testapi/ui/auth/sign.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/opnfv_testapi/ui/auth/sign.py b/opnfv_testapi/ui/auth/sign.py index 80f7e33..42f292e 100644 --- a/opnfv_testapi/ui/auth/sign.py +++ b/opnfv_testapi/ui/auth/sign.py @@ -309,12 +309,15 @@ class LoginHandler(base.BaseHandler): "form_id": form_id, } headers = {'Content-Type': 'application/x-www-form-urlencoded'} - response = requests.post('https://identity.linuxfoundation.org', - data=params, headers=headers) + response = requests.post( + 'https://identity.linuxfoundation.org', + data=params, + headers=headers + ) response_text = response.content if "unrecognized username or password" in response_text: raises.Unauthorized(message.invalid_credentials()) - #generate random token and store in memcache + # generate random token and store in memcache token = base.get_token() resp = {'status': 'success'} mc = memcache.Client(['127.0.0.1:11211'], debug=0) @@ -322,12 +325,13 @@ class LoginHandler(base.BaseHandler): self.set_header("token", token) self.finish_request(resp) + class LogoutHandler(base.BaseHandler): def post(self): input_token = self.request.headers._dict['Token'] mc = memcache.Client(['127.0.0.1:11211'], debug=0) token = mc.get("token") - if not token or not input_token == token : + if not token or not input_token == token: raises.Unauthorized(message.invalid_token()) mc.set("token", '') resp = {'Message': 'You have been logged out successfully.'} |