def adjust_start_date(user, days_early_for_beta, start, course_key):
 if (days_early_for_beta is None):
  return start
 if CourseBetaTesterRole(course_key).has_user(user):
  debug('Adjust start time: user in beta role for %s', course_key)
  delta = timedelta(days_early_for_beta)
  effective = (start - delta)
  return effective
 return start

def adjust_start_date ( user , days_early_for_beta , start , course_key ) : if ( days_early_for_beta is None ) : return start if CourseBetaTesterRole ( course_key ) . has_user ( user ) : debug ( 'Adjust start time: user in beta role for %s' , course_key ) delta = timedelta ( days_early_for_beta ) effective = ( start - delta ) return effective return start
if user is in a beta test group .