]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
fb demo fix
authorBenjamin Golub <bgolub@benjamingolub.com>
Thu, 14 Jan 2010 11:07:58 +0000 (06:07 -0500)
committerBenjamin Golub <bgolub@benjamingolub.com>
Thu, 14 Jan 2010 11:07:58 +0000 (06:07 -0500)
demos/facebook/templates/modules/post.html

index f938c735a7311c5ef7e277987b540be603f7cd33..6b50ac0f726ef1219504c619034b9cca7d99d246 100644 (file)
@@ -15,7 +15,7 @@
         {% if post["attachment"].get("description") %}
           <div class="description">{{ post["attachment"]["description"] }}</div>
         {% end %}
-        {% for media in filter(lambda m: m.get("src") and m["type"] in ("photo", "link"), post["attachment"]["media"]) %}
+        {% for media in filter(lambda m: m.get("src") and m["type"] in ("photo", "link"), post["attachment"].get("media", [])) %}
           <span class="media">
             <a href="{{ media["href"] }}"><img src="{{ media["src"] }}" alt="{{ escape(media.get("alt", "")) }}"/></a>
           </span>