diff options
| author | Marten Kenbeek <marten.knbk@gmail.com> | 2015-03-15 23:54:20 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-03-16 13:31:22 -0400 |
| commit | febcbbf89d978b60ffe13ab839dcc98639c3f522 (patch) | |
| tree | b69b587a6a119f502aadfb94fcc3492e1722aa12 /django | |
| parent | ff71d6b8de97f21208cf41cadb7fbe0bf7134bf3 (diff) | |
[1.8.x] Fixed #24488 -- Made create_default_site() use default pk of 1.
Fixed create_default_site() to use a default value in case
settings.SITE_ID isn't set; refs #23945.
Backport of 818182b514d1c6b379130c440689355b4d231d49 from master
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/sites/management.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/contrib/sites/management.py b/django/contrib/sites/management.py index 5647b6a304..1f403075b8 100644 --- a/django/contrib/sites/management.py +++ b/django/contrib/sites/management.py @@ -25,7 +25,7 @@ def create_default_site(app_config, verbosity=2, interactive=True, using=DEFAULT # can also crop up outside of tests - see #15346. if verbosity >= 2: print("Creating example.com Site object") - Site(pk=settings.SITE_ID, domain="example.com", name="example.com").save(using=using) + Site(pk=getattr(settings, 'SITE_ID', 1), domain="example.com", name="example.com").save(using=using) # We set an explicit pk instead of relying on auto-incrementation, # so we need to reset the database sequence. See #17415. |
