Don't mangle stories with code when updating, just use new story. Thanks Bruno!

This commit is contained in:
Samuel Clay 2014-10-15 17:31:00 -07:00
parent 5650389bb6
commit 021fe32d9f

View file

@ -1030,7 +1030,11 @@ class Feed(models.Model):
original_content = zlib.decompress(existing_story.story_content_z)
# print 'Type: %s %s' % (type(original_content), type(story_content))
if story_content and len(story_content) > 10:
story_content_diff = htmldiff(unicode(original_content), unicode(story_content))
if "<code" in story_content:
# Don't mangle stories with code, just use new
story_content_diff = story_content
else:
story_content_diff = htmldiff(unicode(original_content), unicode(story_content))
else:
story_content_diff = original_content
# logging.debug("\t\tDiff: %s %s %s" % diff.getStats())