def update_comment(request, comment_id, update_data):
 (cc_comment, context) = _get_comment_and_context(request, comment_id)
 _check_editable_fields(cc_comment, update_data, context)
 serializer = CommentSerializer(cc_comment, data=update_data, partial=True, context=context)
 actions_form = CommentActionsForm(update_data)
 if (not (serializer.is_valid() and actions_form.is_valid())):
  raise ValidationError(dict((serializer.errors.items() + actions_form.errors.items())))
 if (set(update_data) - set(actions_form.fields)):
  serializer.save()
  comment_edited.send(sender=None, user=request.user, post=cc_comment)
 api_comment = serializer.data
 _do_extra_actions(api_comment, cc_comment, update_data.keys(), actions_form, context, request)
 return api_comment

def update_comment ( request , comment_id , update_data ) : ( cc_comment , context ) = _get_comment_and_context ( request , comment_id ) _check_editable_fields ( cc_comment , update_data , context ) serializer = CommentSerializer ( cc_comment , data = update_data , partial = True , context = context ) actions_form = CommentActionsForm ( update_data ) if ( not ( serializer . is_valid ( ) and actions_form . is_valid ( ) ) ) : raise ValidationError ( dict ( ( serializer . errors . items ( ) + actions_form . errors . items ( ) ) ) ) if ( set ( update_data ) - set ( actions_form . fields ) ) : serializer . save ( ) comment_edited . send ( sender = None , user = request . user , post = cc_comment ) api_comment = serializer . data _do_extra_actions ( api_comment , cc_comment , update_data . keys ( ) , actions_form , context , request ) return api_comment
given a course_id and comment_id .