evildmp / Arkestra

Arkestra extends Django CMS to provide an intelligent semantic web publishing system for organisations and institutions.
http://arkestra-project.org
BSD 2-Clause "Simplified" License
139 stars 27 forks source link

IntegrityError while importing example database #39

Closed konr4d closed 11 years ago

konr4d commented 12 years ago

When importing example database I get: IntegrityError: Could not load cms.Page(pk=1): duplicate key value violates unique constraint "cms_placeholder_pkey"

Whole trace:

/home/konrad/work/pjwstk/sieci_cms/libs/cms/utils/plugins.py:125: DuplicatePlaceholderWarning: Duplicate placeholder found: body warnings.warn("Duplicate placeholder found: %s" % placeholder, DuplicatePlaceholderWarning) Problem installing fixture 'example_database.json': Traceback (most recent call last): File "/home/konrad/work/pjwstk/sieci_cms/libs/django/core/management/commands/loaddata.py", line 196, in handle obj.save(using=using) File "/home/konrad/work/pjwstk/sieci_cms/libs/django/core/serializers/base.py", line 165, in save models.Model.save_base(self.object, using=using, raw=True) File "/home/konrad/work/pjwstk/sieci_cms/libs/django/db/models/base.py", line 565, in save_base created=(not record_exists), raw=raw, using=using) File "/home/konrad/work/pjwstk/sieci_cms/libs/django/dispatch/dispatcher.py", line 172, in send response = receiver(signal=self, sender=sender, named) File "/home/konrad/work/pjwstk/sieci_cms/libs/cms/signals.py", line 218, in update_placeholders instance.rescan_placeholders() File "/home/konrad/work/pjwstk/sieci_cms/libs/cms/models/pagemodel.py", line 1071, in rescan_placeholders placeholder = Placeholder.objects.create(slot=placeholder_name) File "/home/konrad/work/pjwstk/sieci_cms/libs/django/db/models/manager.py", line 137, in create return self.get_query_set().create(kwargs) File "/home/konrad/work/pjwstk/sieci_cms/libs/django/db/models/query.py", line 377, in create obj.save(force_insert=True, using=self.db) File "/home/konrad/work/pjwstk/sieci_cms/libs/django/db/models/base.py", line 463, in save self.save_base(using=using, force_insert=force_insert, force_update=force_update) File "/home/konrad/work/pjwstk/sieci_cms/libs/django/db/models/base.py", line 551, in save_base result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw) File "/home/konrad/work/pjwstk/sieci_cms/libs/django/db/models/manager.py", line 203, in _insert return insert_query(self.model, objs, fields, **kwargs) File "/home/konrad/work/pjwstk/sieci_cms/libs/django/db/models/query.py", line 1576, in insert_query return query.get_compiler(using=using).execute_sql(return_id) File "/home/konrad/work/pjwstk/sieci_cms/libs/django/db/models/sql/compiler.py", line 910, in execute_sql cursor.execute(sql, params) File "/home/konrad/work/pjwstk/sieci_cms/libs/django/db/backends/util.py", line 40, in execute return self.cursor.execute(sql, params) File "/home/konrad/work/pjwstk/sieci_cms/libs/django/db/backends/postgresql_psycopg2/base.py", line 52, in execute return self.cursor.execute(query, args) IntegrityError: Could not load cms.Page(pk=1): duplicate key value violates unique constraint "cms_placeholder_pkey"

evildmp commented 12 years ago

On Tue, Jul 10, 2012, Konrad Adamczyk reply+i-5529297-55262917f21c8e6c4dff3d6ab31377a88b72cb00-86222@reply.github.co wrote:

When importing example database I get: IntegrityError: Could not load cms.Page(pk=1): duplicate key value violates unique constraint "cms_placeholder_pkey"

I am assuming that you are importing the example database into an existing database - in that case you may well get some conflicts with existing placeholders.

evildmp commented 12 years ago

I'd like to close this - can you confirm that this issue only occurred when loading the example database fixture into an existing database?