]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Check to see if actions field is present in facebook demo
authorBen Darnell <ben@bendarnell.com>
Mon, 25 Apr 2011 06:15:08 +0000 (23:15 -0700)
committerBen Darnell <ben@bendarnell.com>
Mon, 25 Apr 2011 06:15:08 +0000 (23:15 -0700)
Closes #251.

demos/facebook/templates/modules/post.html

index 1738805a714a9e563098d273209e0997648d89f1..77009c52d4e8589de984b27d869540e8319fb6a0 100644 (file)
@@ -9,7 +9,9 @@
       <span class="message">{{ escape(post["message"]) }}</span>
     {% end %}
     <div class="meta">
-      <a href="{{ escape(post["actions"][0]["link"]) }}" class="permalink">{{ locale.format_date(datetime.datetime.strptime(post["created_time"], "%Y-%m-%dT%H:%M:%S+0000")) }}</a>
+      {% if "actions" in post %}
+        <a href="{{ escape(post["actions"][0]["link"]) }}" class="permalink">{{ locale.format_date(datetime.datetime.strptime(post["created_time"], "%Y-%m-%dT%H:%M:%S+0000")) }}</a>
+      {% end %}
     </div>
   </div>
 </div>