var GithubConfigHelper = (function() {

    var updateHidden = function(val) {
        var repoParts = val.split('/');
        $('#githubUser').val($.trim(repoParts[0]));
        $('#githubRepo').val($.trim(repoParts[1]));
    };

    var createRepo = function() {

        var $elm = $('#addonSettingsGithub');
        var $select = $elm.find('select');

        bootbox.prompt('Name your new repo', function(repoName) {
            $.ajax({
                type: 'POST',
                url: '/api/v1/github/repo/create/',
                contentType: 'application/json',
                dataType: 'json',
                data: JSON.stringify({name: repoName}),
                success: function(response) {
                    var repoName = response.user + ' / ' + response.repo;
                    $select.append('<option value="' + repoName + '">' + repoName + '</option>');
                    $select.val(repoName);
                    updateHidden(repoName);
                },
                error: function() {
                    $('#addonSettingsGithub').find('.addon-settings-message')
                        .text('Could not create repository')
                        .removeClass('text-success').addClass('text-danger')
                        .fadeOut(100).fadeIn();
                }
            });
        });
    };

    $(document).ready(function() {

        $('#githubSelectRepo').on('change', function() {
            var value = $(this).val();
            if (value) {
                updateHidden(value);
            }
        });

        $('#githubCreateRepo').on('click', function() {
            createRepo();
        });

        $('#githubImportToken').on('click', function() {
            $.ajax({
                type: 'POST',
                url: nodeApiUrl + 'github/user_auth/',
                contentType: 'application/json',
                dataType: 'json',
                success: function(response) {
                    window.location.reload();
                }
            });
        });

        $('#githubCreateToken').on('click', function() {
            window.location.href = nodeApiUrl + 'github/oauth/';
        });

        $('#githubRemoveToken').on('click', function() {
            bootbox.confirm('Are you sure you want to remove this GitHub authorization?', function(confirm) {
                if (confirm) {
                    $.ajax({
                        type: 'DELETE',
                        url: nodeApiUrl + 'github/oauth/',
                        success: function(response) {
                            window.location.reload();
                        }
                    });
                }
            });
        });

        $('#addonSettingsGithub .addon-settings-submit').on('click', function() {
            if (!$('#githubRepo').val()) {
                return false;
            }
        });

    });

})();

@@ -236,190 +236,669 @@
 var 
-createRepo = function() %7B%0A%0A        var $elm = $('#addonSettingsGithub');%0A        var $select = $elm.find('select');%0A%0A        bootbox.prompt('Name your new repo', function(repoName) %7B
+displayError = function(msg) %7B%0A        $('#addonSettingsGithub').find('.addon-settings-message')%0A            .text('Error: ' + msg)%0A            .removeClass('text-success').addClass('text-danger')%0A            .fadeOut(100).fadeIn();%0A    %7D;%0A%0A    var createRepo = function() %7B%0A%0A        var $elm = $('#addonSettingsGithub');%0A        var $select = $elm.find('select');%0A%0A        bootbox.prompt('Name your new repo', function(repoName) %7B%0A%0A            // Return if cancelled%0A            if (repoName === null)%0A                return;%0A%0A            if (repoName === '') %7B%0A                displayError('Your repo must have a name');%0A                return;%0A            %7D%0A
 %0A   
@@ -1520,249 +1520,50 @@
     
-$('#addonSettingsGithub').find('.addon-settings-message')%0A                        .text('Could not create repository')%0A                        .removeClass('text-success').addClass('text-danger')%0A                        .fadeOut(100).fadeIn(
+displayError('Could not create repository'
 );%0A 

Fix error messages and reduce number of requests for github repo creation.