Spaces:
Zeuscloud
/
m
Sleeping

Eluza133 commited on
Commit
86c9dd3
·
verified ·
1 Parent(s): 76aa98b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -1708,8 +1708,11 @@ def chat():
1708
  {% endif %}
1709
  {% endif %}
1710
  {% if 'post_id' in message %}
1711
- {% set post = [p for p in posts if p['id'] == message['post_id']][0] %}
1712
- <p>Shared post: <a href="{{ url_for('post_page', post_id=message['post_id']) }}">{{ post['title'] }}</a></p>
 
 
 
1713
  {% endif %}
1714
  </div>
1715
  {% endfor %}
 
1708
  {% endif %}
1709
  {% endif %}
1710
  {% if 'post_id' in message %}
1711
+ {% with post = posts|selectattr('id', 'equalto', message['post_id'])|first %}
1712
+ {% if post %}
1713
+ <p>Shared post: <a href="{{ url_for('post_page', post_id=message['post_id']) }}">{{ post['title'] }}</a></p>
1714
+ {% endif %}
1715
+ {% endwith %}
1716
  {% endif %}
1717
  </div>
1718
  {% endfor %}