Anonymous committed e3b998c

Fixed a bug of last commit: default parameter in publish_on field now works
in new projects or projects that doesn't have the table django_site previously.

extra : convert_revision : svn%3Aea932676-bf3b-0410-9f11-03e9079df846/trunk%40140

  • Participants
  • Parent commits 12e17d2

Comments (0)

Files changed (1)

File diario/

 from datetime import datetime
+from django.conf import settings
 from django.contrib.sites.managers import CurrentSiteManager
 from django.contrib.sites.models import Site
 from django.db import models
     publish_on = models.ManyToManyField(
-        default=[Site.objects.get_current().id],
+        default=[settings.SITE_ID],
         verbose_name=_('publish on')
     enable_comments = models.BooleanField(_('enable comments'), default=True)