Skip to content

Commit

Permalink
Fix initial site creation, to check for SITE_ID
Browse files Browse the repository at this point in the history
Fix suggested in #90 by @mrmachine
  • Loading branch information
vdboor committed Oct 7, 2015
1 parent de2dbc6 commit 9f18106
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fluent_pages/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

def make_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
if Site.objects.count() == 0:
site = Site()
site.pk = settings.SITE_ID
site.name = 'example'
site.domain = 'example.com'
site.save()
Site.objects.get_or_create(
pk=settings.SITE_ID,
defaults=dict(
name='example',
domain='example.com',
))


def remove_site(apps, schema_editor):
Expand Down

0 comments on commit 9f18106

Please sign in to comment.