       @renderSelectors('.render')
       @trigger 'special-render'
     )
-    
-  getClassCode: -> @$('.class-code-input').val() or @signupState.get('classCode') 
+
+  getClassCode: -> @$('.class-code-input').val() or @signupState.get('classCode')
 
   onInputClassCode: ->
     @classroom = new Classroom()

  fetchClassByCode: (classCode) ->
    if not classCode
      return Promise.resolve()
      
    new Promise((resolve, reject) ->
      new Classroom().fetchByCode(classCode, {
        success: resolve

        @state.set { classCodeValid: false, segmentCheckValid: false }
    .catch (error) ->
      throw error

  onInputBirthday: ->
    { birthdayYear, birthdayMonth, birthdayDay } = forms.formToObject(@$('form'))
    birthday = new Date Date.UTC(birthdayYear, birthdayMonth - 1, birthdayDay)
    @signupState.set { birthdayYear, birthdayMonth, birthdayDay, birthday }, { silent: true }
    unless _.isNaN(birthday.getTime())
      forms.clearFormAlerts(@$el)

  onSubmitSegmentCheck: (e) ->
    e.preventDefault()

    if @signupState.get('path') is 'student'
      @$('.class-code-input').attr('disabled', true)

      @fetchClassByCode(@getClassCode())
      .then (classroom) =>
        return if @destroyed
