From 569abda653413b2682f01ff615e6bb15f201eb7f Mon Sep 17 00:00:00 2001 From: Waseem Daher Date: Mon, 28 Jul 2014 23:15:12 -0700 Subject: [PATCH] Host "preview failed" image locally. Who knows when this Cloudfront URL will stop working! (imported from commit 39f2908a32c0276b1d87ecedc876c71dd35a9b2f) --- zerver/lib/bugdown/__init__.py | 2 +- zerver/test_bugdown.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zerver/lib/bugdown/__init__.py b/zerver/lib/bugdown/__init__.py index c2e4cb4991..c0e57fe26b 100644 --- a/zerver/lib/bugdown/__init__.py +++ b/zerver/lib/bugdown/__init__.py @@ -297,7 +297,7 @@ class InlineInterestingLinkProcessor(markdown.treeprocessors.Treeprocessor): image_info["title"] = filename image_info["desc"] = "" # Dropbox's "unable to preview" image - image_info["image"] = "https://dt8kf6553cww8.cloudfront.net/static/images/preview_fail-vflc3IDxf.png" + image_info["image"] = "/static/images/preview_fail.png" image_info["is_image"] = is_image return image_info diff --git a/zerver/test_bugdown.py b/zerver/test_bugdown.py index db2ceb0ac6..2510a8e7ad 100644 --- a/zerver/test_bugdown.py +++ b/zerver/test_bugdown.py @@ -209,7 +209,7 @@ class BugdownTest(TestCase): # Don't fail on bad dropbox links msg = "https://meta-dbdev.dev.corp.dropbox.com/photos/cl/ROmr9K1XYtmpneM" converted = bugdown_convert(msg) - self.assertEqual(converted, '

https://meta-dbdev.dev.corp.dropbox.com/photos/cl/ROmr9K1XYtmpneM

\n
') + self.assertEqual(converted, '

https://meta-dbdev.dev.corp.dropbox.com/photos/cl/ROmr9K1XYtmpneM

\n
') def test_twitter_id_extraction(self): self.assertEqual(bugdown.get_tweet_id('http://twitter.com/#!/VizzQuotes/status/409030735191097344'), '409030735191097344')