From 492f50e67761302576642960f2613a74bbae2f6e Mon Sep 17 00:00:00 2001 From: Philipp Kewisch Date: Sun, 6 Mar 2022 19:58:57 +0100 Subject: [PATCH] Update session auth --- pyamo/review.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyamo/review.py b/pyamo/review.py index 2bf0b09..e614811 100644 --- a/pyamo/review.py +++ b/pyamo/review.py @@ -223,7 +223,7 @@ def decide(self, action, comments, versions=None, versionids=None): def flags(self, flags=None): url = AMO_REVIEWERS_API_BASE + '/addon/%s/flags/' % self.addonid - headers = {'Authorization': 'Bearer ' + self.api_token} + headers = {'Authorization': 'Session ' + self.session.cookies.get('sessionid')} req = self.session.patch(url, json=flags or {}, headers=headers, allow_redirects=False) print(req.json()) if not req.status_code == 200: @@ -232,7 +232,7 @@ def flags(self, flags=None): def admin_disable(self): url = AMO_REVIEWERS_API_BASE + '/addon/%s/disable/' % self.addonid - headers = {'Authorization': 'Bearer ' + self.api_token} + headers = {'Authorization': 'Session ' + self.session.cookies.get('sessionid')} req = self.session.post(url, headers=headers, allow_redirects=False) return req.status_code == 202 @@ -253,7 +253,7 @@ def subscription(self, subscribe=True): "un" if not subscribe else "", "un" if self.unlisted else "" ) - headers = {'Authorization': 'Bearer ' + self.api_token} + headers = {'Authorization': 'Session ' + self.session.cookies.get('sessionid')} req = self.session.post(url, headers=headers, allow_redirects=False) return req.status_code == 202