[ckan-changes] commit/ckanclient: John Glover: Bug fix: ckanclient.package_register_post will return HTTP 201 when creating a package so mark this code as a successful call

Bitbucket commits-noreply at bitbucket.org
Thu Jun 23 14:35:00 UTC 2011


1 new changeset in ckanclient:

http://bitbucket.org/okfn/ckanclient/changeset/c418b5fca66b/
changeset:   c418b5fca66b
user:        John Glover
date:        2011-06-23 16:30:32
summary:     Bug fix: ckanclient.package_register_post will return HTTP 201 when creating a package so mark this code as a successful call
affected #:  1 file (7 bytes)

--- a/ckanclient/loaders/base.py	Thu Apr 21 21:04:16 2011 +0200
+++ b/ckanclient/loaders/base.py	Thu Jun 23 15:30:32 2011 +0100
@@ -172,7 +172,7 @@
                         continue
                 print "Registering package..."
                 self.ckanclient.package_register_post(package)
-                if self.ckanclient.last_status == 200:
+                if self.ckanclient.last_status in [200, 201]:
                     print "Registered package '%s' OK." % package['name']
                     sleep(1)
                 elif self.ckanclient.last_status == 403 or '403' in str(self.ckanclient.last_url_error):

Repository URL: https://bitbucket.org/okfn/ckanclient/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list