← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/git-hosting-2xx into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/git-hosting-2xx into lp:launchpad.

Commit message:
Make GitHostingClient._request accept any 2xx response.  (PATCH on a repository returns 204.)

Requested reviews:
  Colin Watson (cjwatson)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/git-hosting-2xx/+merge/261978

Make GitHostingClient._request accept any 2xx response.  (PATCH on a repository returns 204.)
-- 
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== modified file 'lib/lp/code/model/githosting.py'
--- lib/lp/code/model/githosting.py	2015-06-15 10:01:55 +0000
+++ lib/lp/code/model/githosting.py	2015-06-15 15:16:52 +0000
@@ -58,7 +58,7 @@
             kwargs["data"] = json.dumps(json_data)
         response = getattr(session, method)(
             urljoin(self.endpoint, path), timeout=self.timeout, **kwargs)
-        if response.status_code != 200:
+        if (response.status_code // 100) != 2:
             raise HTTPResponseNotOK(response.text)
         return response.json()
 


References