WiP: attempted fix for a migration error

I'm trying a suggestion here:

  https://groups.google.com/forum/#!topic/south-users/HeIhn-TzWVk

.... to try to fix this:

 > core:0037_migrate_data_for_parliamentary_sessions
Error in migration: core:0037_migrate_data_for_parliamentary_sessions
Traceback (most recent call last):
  File "./manage.py", line 50, in <module>
    execute_from_command_line(sys.argv)
  File
"/home/travis/virtualenv/python2.7.8/lib/python2.7/site-packages/django/core/management/__init__.py",
line 399, in execute_from_command_line
    utility.execute()
  File
"/home/travis/virtualenv/python2.7.8/lib/python2.7/site-packages/django/core/management/__init__.py",
line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File
"/home/travis/virtualenv/python2.7.8/lib/python2.7/site-packages/django/core/management/base.py",
line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File
"/home/travis/virtualenv/python2.7.8/lib/python2.7/site-packages/django/core/management/base.py",
line 285, in execute
    output = self.handle(*args, **options)
  File
"/home/travis/virtualenv/python2.7.8/lib/python2.7/site-packages/south/management/commands/migrate.py",
line 111, in handle
    ignore_ghosts = ignore_ghosts,
  File
"/home/travis/virtualenv/python2.7.8/lib/python2.7/site-packages/south/migration/__init__.py",
line 220, in migrate_app
    success = migrator.migrate_many(target, workplan, database)
  File
"/home/travis/virtualenv/python2.7.8/lib/python2.7/site-packages/south/migration/migrators.py",
line 254, in migrate_many
    result = migrator.__class__.migrate_many(migrator, target,
migrations, database)
  File
"/home/travis/virtualenv/python2.7.8/lib/python2.7/site-packages/south/migration/migrators.py",
line 335, in migrate_many
    interactive=self.interactive)
  File
"/home/travis/virtualenv/python2.7.8/lib/python2.7/site-packages/south/db/generic.py",
line 1030, in send_pending_create_signals
    interactive=interactive)
  File
"/home/travis/virtualenv/python2.7.8/lib/python2.7/site-packages/south/db/generic.py",
line 1076, in really_send_create_signal
    db=self.db_alias,
  File
"/home/travis/virtualenv/python2.7.8/lib/python2.7/site-packages/django/dispatch/dispatcher.py",
line 185, in send
    response = receiver(signal=self, sender=sender, **named)
  File
"/home/travis/virtualenv/python2.7.8/lib/python2.7/site-packages/django/contrib/auth/management/__init__.py",
line 101, in create_permissions
    auth_app.Permission.objects.using(db).bulk_create(perms)
  File
"/home/travis/virtualenv/python2.7.8/lib/python2.7/site-packages/django/db/models/query.py",
line 359, in bulk_create
    self._batched_insert(objs_without_pk, fields, batch_size)
  File
"/home/travis/virtualenv/python2.7.8/lib/python2.7/site-packages/django/db/transaction.py",
line 316, in __exit__
    connection.commit()
  File
"/home/travis/virtualenv/python2.7.8/lib/python2.7/site-packages/django/db/backends/__init__.py",
line 171, in commit
    self._commit()
  File
"/home/travis/virtualenv/python2.7.8/lib/python2.7/site-packages/django/db/backends/__init__.py",
line 139, in _commit
    return self.connection.commit()
  File
"/home/travis/virtualenv/python2.7.8/lib/python2.7/site-packages/django/db/utils.py",
line 99, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File
"/home/travis/virtualenv/python2.7.8/lib/python2.7/site-packages/django/db/backends/__init__.py",
line 139, in _commit
    return self.connection.commit()
django.db.utils.IntegrityError: insert or update on table
"auth_permission" violates foreign key constraint
"content_type_id_refs_id_d043b34a"
DETAIL:  Key (content_type_id)=(21) is not present in table
"django_content_type".