mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-16 13:16:33 +00:00
Use href instead of POST form to edit status
This commit is contained in:
parent
7488f8da96
commit
e149a14e73
2 changed files with 7 additions and 8 deletions
|
@ -20,12 +20,9 @@
|
|||
</li>
|
||||
{% if status.status_type != 'GeneratedNote' and status.status_type != 'Rating' %}
|
||||
<li role="menuitem" class="dropdown-item p-0">
|
||||
<form class="" name="edit-{{ status.id }}" action="{% url 'edit-status' status.id %}" method="post">
|
||||
{% csrf_token %}
|
||||
<button class="button is-radiusless is-fullwidth is-small" type="submit">
|
||||
<a href="{% url 'edit-status' status.id %}" class="button is-radiusless is-fullwidth is-small" type="submit">
|
||||
{% trans "Edit" %}
|
||||
</button>
|
||||
</form>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
|
|
|
@ -28,11 +28,13 @@ class EditStatus(View):
|
|||
|
||||
def get(self, request, status_id): # pylint: disable=unused-argument
|
||||
"""load the edit panel"""
|
||||
status = get_object_or_404(models.Status.select_subclasses(), id=status_id)
|
||||
status = get_object_or_404(models.Status.objects.select_subclasses(), id=status_id)
|
||||
status.raise_not_editable(request.user)
|
||||
|
||||
data = {
|
||||
"status": status,
|
||||
"type": status.status_type.lower(),
|
||||
"book": getattr(status, "book", None),
|
||||
"draft": status,
|
||||
}
|
||||
return TemplateResponse(request, "compose.html", data)
|
||||
|
||||
|
|
Loading…
Reference in a new issue