Permalink
Browse files

Support Issue.edit(milestone=None, assignee=None)

  • Loading branch information...
1 parent bf1e3b5 commit d02437f6817bc887f46cb51b8d15281a3fd9ddb2 @quixotique quixotique committed Sep 10, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 github/Issue.py
View
@@ -150,21 +150,21 @@ def delete_labels( self ):
def edit( self, title = GithubObject.NotSet, body = GithubObject.NotSet, assignee = GithubObject.NotSet, state = GithubObject.NotSet, milestone = GithubObject.NotSet, labels = GithubObject.NotSet ):
assert title is GithubObject.NotSet or isinstance( title, ( str, unicode ) ), title
assert body is GithubObject.NotSet or isinstance( body, ( str, unicode ) ), body
- assert assignee is GithubObject.NotSet or isinstance( assignee, NamedUser.NamedUser ), assignee
+ assert assignee is GithubObject.NotSet or assignee is None or isinstance( assignee, NamedUser.NamedUser ), assignee
assert state is GithubObject.NotSet or isinstance( state, ( str, unicode ) ), state
- assert milestone is GithubObject.NotSet or isinstance( milestone, Milestone.Milestone ), milestone
+ assert milestone is GithubObject.NotSet or milestone is None or isinstance( milestone, Milestone.Milestone ), milestone
assert labels is GithubObject.NotSet or all( isinstance( element, ( str, unicode ) ) for element in labels ), labels
post_parameters = dict()
if title is not GithubObject.NotSet:
post_parameters[ "title" ] = title
if body is not GithubObject.NotSet:
post_parameters[ "body" ] = body
if assignee is not GithubObject.NotSet:
- post_parameters[ "assignee" ] = assignee._identity
+ post_parameters[ "assignee" ] = assignee._identity if assignee else ''
if state is not GithubObject.NotSet:
post_parameters[ "state" ] = state
if milestone is not GithubObject.NotSet:
- post_parameters[ "milestone" ] = milestone._identity
+ post_parameters[ "milestone" ] = milestone._identity if milestone else ''
if labels is not GithubObject.NotSet:
post_parameters[ "labels" ] = labels
headers, data = self._requester.requestAndCheck(

0 comments on commit d02437f

Please sign in to comment.