mirror of
https://github.com/mediacms-io/mediacms.git
synced 2026-03-09 22:47:21 -04:00
py
This commit is contained in:
@@ -1 +1 @@
|
||||
VERSION = "8.0"
|
||||
VERSION = "8.12"
|
||||
|
||||
@@ -35,6 +35,7 @@ from ..methods import (
|
||||
)
|
||||
from ..models import (
|
||||
Category,
|
||||
Comment,
|
||||
EncodeProfile,
|
||||
Media,
|
||||
MediaPermission,
|
||||
@@ -302,6 +303,7 @@ class MediaBulkUserActions(APIView):
|
||||
enum=[
|
||||
"enable_comments",
|
||||
"disable_comments",
|
||||
"delete_comments",
|
||||
"delete_media",
|
||||
"enable_download",
|
||||
"disable_download",
|
||||
@@ -386,6 +388,10 @@ class MediaBulkUserActions(APIView):
|
||||
media.update(enable_comments=False)
|
||||
return Response({"detail": f"Comments disabled for {media.count()} media items"})
|
||||
|
||||
elif action == "delete_comments":
|
||||
deleted_count, _ = Comment.objects.filter(media__in=media).delete()
|
||||
return Response({"detail": f"{deleted_count} comments deleted"})
|
||||
|
||||
elif action == "delete_media":
|
||||
count = media.count()
|
||||
media.delete()
|
||||
|
||||
Reference in New Issue
Block a user