diff --git a/django/contrib/syndication/feeds.py b/django/contrib/syndication/feeds.py
index a1f0810..de09e72 100644
a
|
b
|
from django.contrib.sites.models import Site, RequestSite
|
6 | 6 | from django.utils import feedgenerator |
7 | 7 | from django.utils.tzinfo import FixedOffset |
8 | | from django.utils.encoding import smart_unicode, iri_to_uri |
| 8 | from django.utils.encoding import smart_unicode, force_unicode, iri_to_uri |
9 | 9 | from django.conf import settings |
10 | 10 | from django.template import RequestContext |
… |
… |
class Feed(object):
|
121 | 121 | title_tmp = loader.get_template(self.title_template_name) |
122 | 122 | except TemplateDoesNotExist: |
123 | | title_tmp = Template('{{ obj }}') |
| 123 | title_tmp = None |
124 | 124 | try: |
125 | 125 | description_tmp = loader.get_template(self.description_template_name) |
126 | 126 | except TemplateDoesNotExist: |
127 | | description_tmp = Template('{{ obj }}') |
| 127 | description_tmp = None |
128 | 128 | |
129 | 129 | for item in self.__get_dynamic_attr('items', obj): |
… |
… |
class Feed(object):
|
162 | 162 | pubdate = pubdate.replace(tzinfo=FixedOffset(tzOffset)) |
163 | 163 | |
| 164 | if title_tmp: |
| 165 | title_str = title_tmp.render(RequestContext(self.request, {'obj': item, 'site': current_site})) |
| 166 | else: |
| 167 | title_str = force_unicode(item) |
| 168 | |
| 169 | if description_tmp: |
| 170 | description_str = description_tmp.render(RequestContext(self.request, {'obj': item, 'site': current_site})) |
| 171 | else: |
| 172 | description_str = force_unicode(item) |
| 173 | |
164 | 174 | feed.add_item( |
165 | | title = title_tmp.render(RequestContext(self.request, {'obj': item, 'site': current_site})), |
| 175 | title = title_str, |
166 | 176 | link = link, |
167 | | description = description_tmp.render(RequestContext(self.request, {'obj': item, 'site': current_site})), |
| 177 | description = description_str, |
168 | 178 | unique_id = self.__get_dynamic_attr('item_guid', item, link), |
169 | 179 | enclosure = enc, |