mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-12-05 20:12:30 -05:00
@@ -32,6 +32,7 @@ from users.models import User
|
||||
from .forms import ContactForm, MediaForm, SubtitleForm
|
||||
from .helpers import clean_query, produce_ffmpeg_commands
|
||||
from .methods import (
|
||||
check_comment_for_mention,
|
||||
get_user_or_session,
|
||||
is_mediacms_editor,
|
||||
is_mediacms_manager,
|
||||
@@ -1277,6 +1278,9 @@ class CommentDetail(APIView):
|
||||
serializer.save(user=request.user, media=media)
|
||||
if request.user != media.user:
|
||||
notify_user_on_comment(friendly_token=media.friendly_token)
|
||||
# here forward the comment to check if a user was mentioned
|
||||
if settings.ALLOW_MENTION_IN_COMMENTS:
|
||||
check_comment_for_mention(friendly_token=media.friendly_token, comment_text=serializer.data['text'])
|
||||
return Response(serializer.data, status=status.HTTP_201_CREATED)
|
||||
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user