Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Francedata fixes #27

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Francedata fixes #27

wants to merge 5 commits into from

Commits on May 25, 2016

  1. Bugfix: Front National is in two countries

    So a duplicate fingerprint would fail to pass unique test. Fixes:
    
    + francedata_import_representatives
    cTraceback (most recent call last):
      File "/home/jpic/work/lqdn/lqdn_env/bin/francedata_import_representatives", line 9, in <module>
        load_entry_point('django-representatives==0.0.19', 'console_scripts', 'francedata_import_representatives')()
      File "/home/jpic/work/lqdn/django-representatives/representatives/contrib/francedata/import_representatives.py", line 317, in main
        an_importer.manage_rep(rep)
      File "/home/jpic/work/lqdn/lqdn_env/lib/python2.7/site-packages/django/utils/decorators.py", line 145, in inner
        return func(*args, **kwargs)
      File "/home/jpic/work/lqdn/django-representatives/representatives/contrib/francedata/import_representatives.py", line 145, in manage_rep
        self.add_mandates(representative, rep_json)
      File "/home/jpic/work/lqdn/django-representatives/representatives/contrib/francedata/import_representatives.py", line 184, in add_mandates
        name=rep_json.get('parti_ratt_financier'), country=self.france)
      File "/home/jpic/work/lqdn/lqdn_env/lib/python2.7/site-packages/django/db/models/manager.py", line 127, in manager_method
        return getattr(self.get_queryset(), name)(*args, **kwargs)
      File "/home/jpic/work/lqdn/lqdn_env/lib/python2.7/site-packages/django/db/models/query.py", line 407, in get_or_create
        return self._create_object_from_params(lookup, params)
      File "/home/jpic/work/lqdn/lqdn_env/lib/python2.7/site-packages/django/db/models/query.py", line 447, in _create_object_from_params
        six.reraise(*exc_info)
      File "/home/jpic/work/lqdn/lqdn_env/lib/python2.7/site-packages/django/db/models/query.py", line 439, in _create_object_from_params
        obj = self.create(**params)
      File "/home/jpic/work/lqdn/lqdn_env/lib/python2.7/site-packages/django/db/models/query.py", line 348, in create
        obj.save(force_insert=True, using=self.db)
      File "/home/jpic/work/lqdn/django-representatives/representatives/models.py", line 68, in save
        super(HashableModel, self).save(*args, **kwargs)
      File "/home/jpic/work/lqdn/lqdn_env/lib/python2.7/site-packages/django/db/models/base.py", line 734, in save
        force_update=force_update, update_fields=update_fields)
      File "/home/jpic/work/lqdn/lqdn_env/lib/python2.7/site-packages/django/db/models/base.py", line 762, in save_base
        updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
      File "/home/jpic/work/lqdn/lqdn_env/lib/python2.7/site-packages/django/db/models/base.py", line 846, in _save_table
        result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
      File "/home/jpic/work/lqdn/lqdn_env/lib/python2.7/site-packages/django/db/models/base.py", line 885, in _do_insert
        using=using, raw=raw)
      File "/home/jpic/work/lqdn/lqdn_env/lib/python2.7/site-packages/django/db/models/manager.py", line 127, in manager_method
        return getattr(self.get_queryset(), name)(*args, **kwargs)
      File "/home/jpic/work/lqdn/lqdn_env/lib/python2.7/site-packages/django/db/models/query.py", line 920, in _insert
        return query.get_compiler(using=using).execute_sql(return_id)
      File "/home/jpic/work/lqdn/lqdn_env/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 974, in execute_sql
        cursor.execute(sql, params)
      File "/home/jpic/work/lqdn/lqdn_env/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
        return self.cursor.execute(sql, params)
      File "/home/jpic/work/lqdn/lqdn_env/lib/python2.7/site-packages/django/db/utils.py", line 98, in __exit__
        six.reraise(dj_exc_type, dj_exc_value, traceback)
      File "/home/jpic/work/lqdn/lqdn_env/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
        return self.cursor.execute(sql, params)
      File "/home/jpic/work/lqdn/lqdn_env/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 318, in execute
        return Database.Cursor.execute(self, query, params)
    django.db.utils.IntegrityError: UNIQUE constraint failed: representatives_constituency.fingerprint
    jpic committed May 25, 2016
    Configuration menu
    Copy the full SHA
    e4d8278 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a415682 View commit details
    Browse the repository at this point in the history

Commits on May 26, 2016

  1. Support database errors

    jpic committed May 26, 2016
    Configuration menu
    Copy the full SHA
    269e89b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    be404b7 View commit details
    Browse the repository at this point in the history
  3. Remove duplicate test

    jpic committed May 26, 2016
    Configuration menu
    Copy the full SHA
    2d20fde View commit details
    Browse the repository at this point in the history