From 1de6b7e7641f2c0cb101a82385cee569aa786e3f Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Fri, 13 May 2016 19:07:48 +0200 Subject: implement star/unstar for projects --- gitlab/exceptions.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gitlab/exceptions.py') diff --git a/gitlab/exceptions.py b/gitlab/exceptions.py index 8190696..49a3728 100644 --- a/gitlab/exceptions.py +++ b/gitlab/exceptions.py @@ -116,7 +116,12 @@ def raise_error_from_response(response, error, expected_code=200): class to raise. Should be inherited from GitLabError """ - if expected_code == response.status_code: + if isinstance(expected_code, int): + expected_codes = [expected_code] + else: + expected_codes = expected_code + + if response.status_code in expected_codes: return try: -- cgit v1.2.1