Skip to content

Commit

Permalink
[#3820] Fix problem with non unicode strings in feed creation
Browse files Browse the repository at this point in the history
390dae8 tried to fix this problem, but it
only fixed it in some cases. In some of the cases, the `escape` function
would return a `str` instead of a `unicode` which wouldn't be converted
correctly, before calling the _write method on the `XMLGenerator`.
  • Loading branch information
punchagan committed Oct 30, 2019
1 parent 78dd6d9 commit e4b4809
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion akvo/rsr/feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def escape(data, entities={}):
bit = data[start:]
bit = __escape(bit, entities)
bits.extend(bit)
data = ''.join(bits)
data = u''.join(bits)
return data


Expand Down
2 changes: 2 additions & 0 deletions akvo/rsr/tests/test_feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def test_updates_feed(self):
title = u'Update de développement'
text = 'What an amazing update!'
self.create_project_update(project, user, title, text)
empty_title = ''
self.create_project_update(project, user, empty_title, text)

response = self.c.get('/rss/updates/{}'.format(project.pk), follow=True)

Expand Down

0 comments on commit e4b4809

Please # to comment.