Skip to content

Commit

Permalink
Release commit for v.0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerd77 authored and holgerd77 committed Jan 11, 2016
1 parent 53f327b commit c2cb6dc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dynamic_scraper/spiders/django_spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def parse(self, response):
only_main_page_idfs = False

is_double = False
if only_main_page_idfs:
if only_main_page_idfs and self.conf['DO_ACTION']:
item, is_double = self._check_for_double_item(item)

# Don't go on reading detail pages when...
Expand Down
25 changes: 16 additions & 9 deletions tests/scraper/scraper_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from django.test import TestCase

from scrapy import log, signals
from scrapy.exceptions import DropItem

from scrapy.utils.project import get_project_settings
settings = get_project_settings()
Expand Down Expand Up @@ -38,16 +39,22 @@ def __init__(self, *args, **kwargs):
class DjangoWriterPipeline(object):

def process_item(self, item, spider):
item['event_website'] = spider.ref_object
if spider.conf['DO_ACTION']:
try:
item['event_website'] = spider.ref_object

checker_rt = SchedulerRuntime()
checker_rt.save()
item['checker_runtime'] = checker_rt

if not 'description' in item or item['description'] == None:
item['description'] = u''

item.save()
except IntegrityError, e:
spider.log(str(e), log.ERROR)
raise DropItem("Missing attribute.")

checker_rt = SchedulerRuntime()
checker_rt.save()
item['checker_runtime'] = checker_rt

if not 'description' in item or item['description'] == None:
item['description'] = u''

item.save()
return item


Expand Down

0 comments on commit c2cb6dc

Please sign in to comment.