Permalink
Browse files

fix multi-domain issue

  • Loading branch information...
1 parent 34a50e9 commit aa31a4e32470bb33106381223986577b7d948b9a no committed Mar 27, 2013
Showing with 5 additions and 2 deletions.
  1. +5 −2 django/contrib/syndication/views.py
@@ -3,7 +3,7 @@
from calendar import timegm
from django.conf import settings
-from django.contrib.sites.models import get_current_site
+from django.contrib.sites.models import RequestSite
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.http import HttpResponse, Http404
from django.template import loader, TemplateDoesNotExist, RequestContext
@@ -115,7 +115,10 @@ def get_feed(self, obj, request):
Returns a feedgenerator.DefaultFeed object, fully populated, for
this feed. Raises FeedDoesNotExist for invalid parameters.
"""
- current_site = get_current_site(request)
+
+ # Fixed: if a site has more than one domains, the rss links should use the domain that
+ # user actually used, not the one set in database.
+ current_site = RequestSite(request)
link = self.__get_dynamic_attr('link', obj)
link = add_domain(current_site.domain, link, request.is_secure())

0 comments on commit aa31a4e

Please sign in to comment.