'Check that the POST parameters are valid.
Arguments:
request (HttpRequest): The request object.
has_initial_verification (bool): Whether the user has an initial verification attempt.
Returns:
HttpResponse or None'

def _validate_parameters(self, request, has_initial_verification):

    params = {param_name: request.POST[param_name] for param_name in ['face_image', 'photo_id_image', 'course_key', 'full_name'] if (param_name in request.POST)}
    if (('photo_id_image' not in params) and (not has_initial_verification)):
        log.error('User    %s    does    not    have    an    initial    verification    attempt    and    no    photo    ID    image    data    was    provided.    This    most    likely    means    that    the    JavaScript    client    is    not    correctly    constructing    the    request    to    submit    photos.', request.user.id)
        return (None, HttpResponseBadRequest(_('Photo    ID    image    is    required    if    the    user    does    not    have    an    initial    verification    attempt.')))
    if ('face_image' not in params):
        msg = _('Missing    required    parameter    face_image')
        return (None, HttpResponseBadRequest(msg))
    if ('course_key' in params):
        try:
            params['course_key'] = CourseKey.from_string(params['course_key'])
        except InvalidKeyError:
            return (None, HttpResponseBadRequest(_('Invalid    course    key')))
    return (params, None)
