diff options
| author | 2012-06-16 13:38:24 +0200 | |
|---|---|---|
| committer | 2012-06-16 13:38:28 +0200 | |
| commit | e383e91973bdbf0b6b77c739249225e3a85b9f24 (patch) | |
| tree | d963ff0c1f10896f29a32ee90ff97f4ecf7b6266 /pygithub3/requests | |
| parent | Remove list_labels from repo service (diff) | |
| download | python-github3-e383e91973bdbf0b6b77c739249225e3a85b9f24.tar.xz python-github3-e383e91973bdbf0b6b77c739249225e3a85b9f24.zip | |
Tests on services.issues working
Also fix some bugs
Diffstat (limited to 'pygithub3/requests')
| -rw-r--r-- | pygithub3/requests/base.py | 4 | ||||
| -rw-r--r-- | pygithub3/requests/issues/milestones.py | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/pygithub3/requests/base.py b/pygithub3/requests/base.py index c4fe5cc..6088bae 100644 --- a/pygithub3/requests/base.py +++ b/pygithub3/requests/base.py @@ -27,8 +27,8 @@ class Body(object): def parse(self): """ Parse body with schema-required rules """ if not hasattr(self.content, 'items'): - raise ValidationError("'%s' needs a content dictionary" - % self.__class__.__name__) + raise ValidationError("It needs a content dictionary (%s)" % ( + self.content, )) parsed = dict([(key, self.content[key]) for key in self.schema if key in self.content]) for attr_required in self.required: diff --git a/pygithub3/requests/issues/milestones.py b/pygithub3/requests/issues/milestones.py index f695e1f..4093c7e 100644 --- a/pygithub3/requests/issues/milestones.py +++ b/pygithub3/requests/issues/milestones.py @@ -24,8 +24,9 @@ class Create(Request): def clean_body(self): # Test if API normalize it state = self.body.get('state', '') - if state.lower() not in ('open', 'closed'): + if state and state.lower() not in ('open', 'closed'): raise ValidationError("'state' must be 'open' or 'closed'") + return self.body class Update(Create): |
