Fixes cache of status interact

The CSRF token was being cached which caused submits to fail
This commit is contained in:
Mouse Reeve
2022-01-06 11:07:22 -08:00
parent 32ac4111aa
commit e416ef05e8
4 changed files with 26 additions and 22 deletions

View File

@ -1,7 +1,6 @@
{% extends 'components/card.html' %}
{% load i18n %}
{% load utilities %}
{% load cache %}
{% block card-header %}
<div
@ -31,7 +30,6 @@
{# nothing here #}
{% elif request.user.is_authenticated %}
{% cache 259200 interact request.user.id status.id %}
<div class="card-footer-item">
{% trans "Reply" as button_text %}
{% include 'snippets/toggle/toggle_button.html' with controls_text="show_comment" controls_uid=status.id text=button_text icon_with_text="comment" class="is-small is-light is-transparent toggle-button" focus="id_content_reply" %}
@ -47,7 +45,6 @@
{% include 'snippets/status/status_options.html' with class="is-small is-light is-transparent" right=True %}
</div>
{% endif %}
{% endcache %}
{% else %}

View File

@ -20,17 +20,21 @@
</li>
{% if status.status_type != 'GeneratedNote' and status.status_type != 'Rating' %}
<li role="menuitem" class="dropdown-item p-0">
<a href="{% url 'edit-status' status.id %}" class="button is-radiusless is-fullwidth is-small" type="submit">
{% trans "Edit" %}
</a>
<span class="control">
<a href="{% url 'edit-status' status.id %}" class="button is-radiusless is-fullwidth is-small" type="submit">
{% trans "Edit" %}
</a>
</span>
</li>
{% endif %}
{% else %}
{# things you can do to other people's statuses #}
<li role="menuitem" class="dropdown-item p-0">
<a href="{% url 'direct-messages-user' status.user|username %}" class="button is-small is-white is-radiusless is-fullwidth">
{% trans "Send direct message" %}
</a>
<span class="control">
<a href="{% url 'direct-messages-user' status.user|username %}" class="button is-small is-white is-radiusless is-fullwidth">
{% trans "Send direct message" %}
</a>
</span>
</li>
<li role="menuitem" class="dropdown-item p-0">
{% include 'snippets/report_button.html' with user=status.user status=status %}