Skip to content
This repository has been archived by the owner on Oct 12, 2021. It is now read-only.

crash from election query problem in scrapecalaccesscampaignpropositions.py #204

Open
rkiddy opened this issue Mar 27, 2015 · 4 comments
Open

Comments

@rkiddy
Copy link
Contributor

rkiddy commented Mar 27, 2015

I ran the setup commands for raw-data and campaign-browser. These had worked a few days ago.

The full log of the setup and import is at http://opencalaccess.org/ccdc/cb_issue_rrk1_log.txt

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/calaccess_campaign_browser/management/commands/buildcalaccesscampaignbrowser.py", line 16, in handle
    call_command("scrapecalaccesscampaignpropositions")
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 115, in call_command
    return klass.execute(*args, **defaults)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python2.7/dist-packages/calaccess_campaign_browser/management/commands/__init__.py", line 33, in handle
    self.process_results(results)
  File "/usr/local/lib/python2.7/dist-packages/calaccess_campaign_browser/management/commands/scrapecalaccesscampaignpropositions.py", line 232, in process_results
    election_type='SPECIAL_RUNOFF'
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", line 92, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 357, in get
    self.model._meta.object_name)
calaccess_campaign_browser.models.DoesNotExist: Election matching query does not exist.
@palewire
Copy link
Owner

Thanks, I'll take a look at this when I get the time. The scrapers were put together rapidly during a hackathon earlier this year so they need roadtesting like this.

@rkiddy
Copy link
Contributor Author

rkiddy commented Mar 31, 2015

Any reason that the scrapecalaccesscampaignpropositions.py command does not have a handle function? I am still trying to grok some of this. I guess a handle function is optional. But it surely is useful in clarifying what the command is doing.

@palewire
Copy link
Owner

I believe it is because it is a subclass of another class that has that method. Perhaps overengineered.

@rkiddy
Copy link
Contributor Author

rkiddy commented May 26, 2015

Still happening with newly downloaded data.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants