def spider_closed(self, spider):
     #import ipdb; ipdb.set_trace()
     unsent_gigs_list = self.check_gigs_sent(spider.relevant_gigs_list)
     if unsent_gigs_list:
         new_email = Email(unsent_gigs_list)
         new_email.send()
         # loop back through and save each one as sent.
         self.record_sent_gigs(unsent_gigs_list)
         self.cursor.close()
 def spider_closed(self, spider):
     # import ipdb; ipdb.set_trace()
     unsent_gigs_list = self.check_gigs_sent(spider.relevant_gigs_list)
     if unsent_gigs_list:
         new_email = Email(unsent_gigs_list)
         new_email.send()
         # loop back through and save each one as sent.
         self.record_sent_gigs(unsent_gigs_list)
         self.cursor.close()
Example #3
0
 def spider_closed(self, spider):
     """
     Email all the gigs that should be sent, and record that they were sent.
     """
     new_email = Email()
     message = new_email.build_message_from_gigs(self.gigs_to_send)
     new_email.send(settings.TO_EMAIL, message)
     # loop back through and save each one as sent.
     self.record_sent_gigs(self.gigs_to_send)
     self.cursor.close()