diff options
author | 2012-05-12 19:04:23 +0200 | |
---|---|---|
committer | 2012-05-12 22:47:09 +0200 | |
commit | 24a3ed5dcd2264a64e234ea7bd526049fafe7616 (patch) | |
tree | 6131f221a9bf9b596dc139715d4e79f090bb55c3 /pygithub3/requests/pull_requests/comments.py | |
parent | Deleted 'dispatch' decorator. No sense (diff) | |
download | python-github3-24a3ed5dcd2264a64e234ea7bd526049fafe7616.tar.xz python-github3-24a3ed5dcd2264a64e234ea7bd526049fafe7616.zip |
Some fixes/typos and 'validate_body' related
Diffstat (limited to 'pygithub3/requests/pull_requests/comments.py')
-rw-r--r-- | pygithub3/requests/pull_requests/comments.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/pygithub3/requests/pull_requests/comments.py b/pygithub3/requests/pull_requests/comments.py index fa1e5b6..dd69894 100644 --- a/pygithub3/requests/pull_requests/comments.py +++ b/pygithub3/requests/pull_requests/comments.py @@ -1,4 +1,6 @@ -from pygithub3.requests.base import Request +# -*- encoding: utf-8 -*- + +from pygithub3.requests.base import Request, ValidationError from pygithub3.resources.pull_requests import Comment @@ -20,13 +22,14 @@ class Create(Request): 'required': ('body',), } - def validate_body(self, body): - if (not ('commit_id' in body and - 'path' in body and - 'position' in body) and - not 'in_reply_to' in body): + def clean_body(self): + if (not ('commit_id' in self.body and + 'path' in self.body and + 'position' in self.body) and + not 'in_reply_to' in self.body): raise ValidationError('supply either in_reply_to or commit_id, ' 'path, and position') + return self.body class Edit(Request): |