forked from mirrors/bookwyrm
Don't allow delete and redraft of ratings
This commit is contained in:
parent
521f917d01
commit
936d68f0ed
2 changed files with 2 additions and 2 deletions
|
@ -19,7 +19,7 @@
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
{% if status.status_type != 'GeneratedNote' %}
|
{% if status.status_type != 'GeneratedNote' and status.status_type != 'Rating' %}
|
||||||
<li role="menuitem">
|
<li role="menuitem">
|
||||||
<form class="dropdown-item pt-0 pb-0" name="delete-{{status.id}}" action="{% url 'redraft' status.id %}" method="post">
|
<form class="dropdown-item pt-0 pb-0" name="delete-{{status.id}}" action="{% url 'redraft' status.id %}" method="post">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
|
@ -104,7 +104,7 @@ class DeleteAndRedraft(View):
|
||||||
status = get_object_or_404(
|
status = get_object_or_404(
|
||||||
models.Status.objects.select_subclasses(), id=status_id
|
models.Status.objects.select_subclasses(), id=status_id
|
||||||
)
|
)
|
||||||
if isinstance(status, models.GeneratedNote):
|
if isinstance(status, (models.GeneratedNote, models.Rating)):
|
||||||
return HttpResponseBadRequest()
|
return HttpResponseBadRequest()
|
||||||
|
|
||||||
# don't let people redraft other people's statuses
|
# don't let people redraft other people's statuses
|
||||||
|
|
Loading…
Reference in a new issue