-
Notifications
You must be signed in to change notification settings - Fork 39
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
Site
does not exist during migrations for sharedcontent
plugin.
#55
Comments
If you are going down that path why not put Should the Another option maybe to to register the call against a |
Or just move the It's a data migration that only creates a default site if one doesn't already exist, so it should be safe to add this into an existing migration without damaging existing installations? Then |
FYI, I have worked around this in my project by adding a new migration that duplicates the
|
Good points! Sorry for not replying earlier (due to holidays).
|
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, noSite
object exists.If
django-fluent-pages
is also installed, its migrations will actually create a defaultSite
object if none exist. But whendjango-fluent-contents
is used on its own, this doesn't happen.Perhaps the
make_site
code fromdjango-fluent-pages
should be abstracted intodjango-fluent-utils
and called byfluent_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
The text was updated successfully, but these errors were encountered: