Commit 70e3e2e0 authored by Piotr Jakimiak's avatar Piotr Jakimiak Committed by Tim Graham
Browse files

Fixed #24774 -- Made contrib.site's Site.domain field unique

parent 4c2197db
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -565,6 +565,7 @@ answer newbie questions, and generally made Django that much better:
    Philip Lindborg <philip.lindborg@gmail.com>
    Philippe Raoult <philippe.raoult@n2nsoft.com>
    phil@produxion.net
    Piotr Jakimiak <piotr.jakimiak@gmail.com>
    Piotr Lewandowski <piotr.lewandowski@gmail.com>
    plisk
    polpak@yahoo.com
+20 −0
Original line number Diff line number Diff line
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import django.contrib.sites.models
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('sites', '0001_initial'),
    ]

    operations = [
        migrations.AlterField(
            model_name='site',
            name='domain',
            field=models.CharField(max_length=100, unique=True, validators=[django.contrib.sites.models._simple_domain_name_validator], verbose_name='domain name'),
        ),
    ]
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ class SiteManager(models.Manager):
class Site(models.Model):

    domain = models.CharField(_('domain name'), max_length=100,
        validators=[_simple_domain_name_validator])
        validators=[_simple_domain_name_validator], unique=True)
    name = models.CharField(_('display name'), max_length=50)
    objects = SiteManager()

+5 −0
Original line number Diff line number Diff line
@@ -23,6 +23,11 @@ The sites framework is mainly based on a simple model:

        The domain name associated with the Web site.

        .. versionchanged:: 1.9

            The ``domain`` field was set to be
            :attr:`~django.db.models.Field.unique`.

    .. attribute:: name

        A human-readable "verbose" name for the Web site.
+3 −0
Original line number Diff line number Diff line
@@ -447,6 +447,9 @@ Miscellaneous

* Support for PostGIS 1.5 has been dropped.

* The ``django.contrib.sites.models.Site.domain`` field was changed to be
  :attr:`~django.db.models.Field.unique`.

.. _deprecated-features-1.9:

Features deprecated in 1.9
Loading