         data: @$form.serializeJSON()
       ).done((data) =>
         @$form.empty()
-        @$form.append "<div class='success'>#{@welcomeMessage()}<div>"
+        @$form.append "<div class='success'>#{@welcomeMessage(data)}<div>"
       ).fail((jqXHR) =>
         errors = JSON.parse(jqXHR.responseText).message
         @showErrors(errors)



    showErrors: (errors) ->
      @processTeacherErrors(errors) if @teacher

      for fieldName, error of errors
        $f = @field(fieldName).parent()
        $f.addClass 'error-field'
        $f.prepend "<p class=\"error-message\">#{error}</p>"

    clearErrors: ->
      @$form.find('.error-field').removeClass 'error-field'

    setupSelectBoxes: ->
      @el('select').select2(width: "262px", minimumResultsForSearch: 10)

    isStudent: ->
      @accountType == 'student'

    isTeacher: ->
      @accountType == 'teacher'

    welcomeMessage: (data) ->
      if @isStudent()
        "<h3>Thanks for signing up!</h3>" +
        "<p>You have successfully registered #{data.first_name} #{data.last_name} " +
        " with the user name <span class=\"big\">#{data.login}</span>.</p>" +
        "Use this user name and password you provided to sign in.</p>"
      else
        "<h3>Thanks for signing up!</h3>" +
