Skip to content

Commit

Permalink
bug fix '' instead of none for nonexistent param
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubkrafka committed Mar 18, 2021
1 parent 98f339d commit 2c3a471
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kingfisher_scrapy/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def spider_closed(self, spider, reason):
def response_callback(response):
if not response.code == 200:
spider.logger.warning(
'Failed to post close collection. API status code: {}'.format(response.code))
"Failed to post close collection. API status code: {}".format(response.code))

self._post_async("api/v1/close_collection", data, response_callback)

Expand All @@ -373,13 +373,13 @@ def item_scraped(self, item, spider):

data = {
"collection_id": self.collection_id,
"path": os.path.join(item.get("files_store", None), item.get("path", None)),
"url": item.get('url', None)
"path": os.path.join(item.get("files_store", ""), item.get("path", "")),
"url": item.get("url", None)
}

if isinstance(item, FileError):
# in case of error send info about it to api
data['errors'] = json.dumps(item.get("errors", None))
data["errors"] = json.dumps(item.get("errors", None))

def response_callback(response):
if not response.code == 200:
Expand Down

0 comments on commit 2c3a471

Please sign in to comment.