def parse_request_data_and_get_user(request, course_key):
 certificate_exception = parse_request_data(request)
 user = (certificate_exception.get('user_name', '') or certificate_exception.get('user_email', ''))
 if (not user):
  raise ValueError(_('Student username/email field is required and can not be empty. Kindly fill in username/email and then press "Add to Exception List" button.'))
 db_user = get_student(user, course_key)
 return (certificate_exception, db_user)

def parse_request_data_and_get_user ( request , course_key ) : certificate_exception = parse_request_data ( request ) user = ( certificate_exception . get ( 'user_name' , '' ) or certificate_exception . get ( 'user_email' , '' ) ) if ( not user ) : raise ValueError ( _ ( 'Student username/email field is required and can not be empty. Kindly fill in username/email and then press "Add to Exception List" button.' ) ) db_user = get_student ( user , course_key ) return ( certificate_exception , db_user )
parse request data into certificate exception and user object .