Author: mtredinnick
Date: 2007-09-14 02:12:47 -0500 (Fri, 14 Sep 2007)
New Revision: 6174
Modified:
django/trunk/django/contrib/sites/models.py
Log:
Fixed #4951 -- Improved host retrieval in sites.models.RequestSite. Thanks,
Caleb.
Modified: django/trunk/django/contrib/sites/models.py
===================================================================
--- django/trunk/django/contrib/sites/models.py 2007-09-14 07:02:55 UTC (rev
6173)
+++ django/trunk/django/contrib/sites/models.py 2007-09-14 07:12:47 UTC (rev
6174)
@@ -1,5 +1,6 @@
from django.db import models
from django.utils.translation import ugettext_lazy as _
+from django.http import get_host
class SiteManager(models.Manager):
def get_current(self):
@@ -36,7 +37,7 @@
The save() and delete() methods raise NotImplementedError.
"""
def __init__(self, request):
- self.domain = self.name = request.META['SERVER_NAME']
+ self.domain = self.name = get_host(request)
def __unicode__(self):
return self.domain
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---