Mercurial > public > sg101
comparison core/management/commands/ssl_images.py @ 988:65b2bc9cb3cc
Fix Unicode error while logging news changes.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 29 Oct 2015 20:15:52 -0500 |
parents | 76525f5ac2b1 |
children | fc528d4509b0 |
comparison
equal
deleted
inserted
replaced
987:76525f5ac2b1 | 988:65b2bc9cb3cc |
---|---|
279 img.set('src', new_src) | 279 img.set('src', new_src) |
280 changed = True | 280 changed = True |
281 | 281 |
282 if changed: | 282 if changed: |
283 result = lxml.html.tostring(root, encoding='utf-8') | 283 result = lxml.html.tostring(root, encoding='utf-8') |
284 return result[5:-6] # strip off parent div we added | 284 result = result[5:-6] # strip off parent div we added |
285 return result.decode('utf-8') | |
285 return html | 286 return html |
286 | 287 |
287 | 288 |
288 def html_check(html): | 289 def html_check(html): |
289 """Return True if the given HTML fragment has <img> tags with src attributes | 290 """Return True if the given HTML fragment has <img> tags with src attributes |