Skip to content

Site does not exist during migrations for sharedcontent plugin. #55

@mrmachine

Description

@mrmachine

During migrations, Django tries to evaluate the default value for the site field in order to create the model.

The default is a callable that returns Site.objects.get_current().pk. On a fresh database, no Site object exists.

If django-fluent-pages is also installed, its migrations will actually create a default Site object if none exist. But when django-fluent-contents is used on its own, this doesn't happen.

Perhaps the make_site code from django-fluent-pages should be abstracted into django-fluent-utils and called by fluent_contents.plugins.sharedcontent.utils.get_current_site_id()?

See: https://github.com/edoburu/django-fluent-pages/blob/master/fluent_pages/migrations/0001_initial.py#L10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions