diff --git a/catalog/templates/catalog_edit.html b/catalog/templates/catalog_edit.html index 4d9438d6..39d674d0 100644 --- a/catalog/templates/catalog_edit.html +++ b/catalog/templates/catalog_edit.html @@ -49,14 +49,12 @@ {% endfor %} - {% if request.user.is_staff %} + {% if item.class_name == "movie" or item.class_name == "tvshow" %}
- - {% if item.class_name == "movie" or item.class_name == "tvshow" %}
{% trans '切换分类' %}
-
+ {% csrf_token %} {% if item.class_name == "movie" %} @@ -68,8 +66,15 @@ {% endif %}
- {% endif %} +
+
+ {% endif %} + {% if request.user.is_staff %} +
+
+ +\
{% trans '合并到另一条目' %}
diff --git a/catalog/views.py b/catalog/views.py index d625a410..9d13f34d 100644 --- a/catalog/views.py +++ b/catalog/views.py @@ -175,8 +175,6 @@ def delete(request, item_path, item_uuid): def recast(request, item_path, item_uuid): if request.method != "POST": return HttpResponseBadRequest() - if not request.user.is_staff: - raise PermissionDenied() item = get_object_or_404(Item, uid=base62.decode(item_uuid)) cls = request.POST.get("class") model = TVShow if cls == "tvshow" else (Movie if cls == "movie" else None)