Skip to content

Commit

Permalink
MR (un)subscribe: don't fail if state doesn't change
Browse files Browse the repository at this point in the history
  • Loading branch information
Gauvain Pocentek committed Aug 7, 2016
1 parent 178bfb7 commit d7967c6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gitlab/objects.py
Expand Up @@ -1370,7 +1370,8 @@ def subscribe(self, **kwargs):

r = self.gitlab._raw_post(url, **kwargs)
raise_error_from_response(r, GitlabSubscribeError, [201, 304])
self._set_from_dict(r.json())
if r.status_code == 201:
self._set_from_dict(r.json())

def unsubscribe(self, **kwargs):
"""Unsubscribe a MR.
Expand All @@ -1385,7 +1386,8 @@ def unsubscribe(self, **kwargs):

r = self.gitlab._raw_delete(url, **kwargs)
raise_error_from_response(r, GitlabUnsubscribeError, [200, 304])
self._set_from_dict(r.json())
if r.status_code == 200:
self._set_from_dict(r.json())

def cancel_merge_when_build_succeeds(self, **kwargs):
"""Cancel merge when build succeeds."""
Expand Down

0 comments on commit d7967c6

Please sign in to comment.