diff --git a/auth/auth_context.py b/auth/auth_context.py index 2aad14685..b97ffa02d 100644 --- a/auth/auth_context.py +++ b/auth/auth_context.py @@ -20,7 +20,8 @@ def get_authenticated_user(): set_authenticated_user(loaded) user = loaded - logger.debug('Returning authenticated user: %s', user.username) + if user: + logger.debug('Returning authenticated user: %s', user.username) return user diff --git a/initdb.py b/initdb.py index 0f6696b7d..fdb3f8e01 100644 --- a/initdb.py +++ b/initdb.py @@ -355,6 +355,12 @@ def populate_database(): build2.uuid = 'deadpork-dead-pork-dead-porkdeadpork' build2.save() + build3 = model.create_repository_build(building, token, job_config, + 'f49d07f9-93da-474d-ad5f-c852107c3892', + 'build-name', trigger) + build3.uuid = 'deadduck-dead-duck-dead-duckdeadduck' + build3.save() + org = model.create_organization('buynlarge', 'quay@devtable.com', new_user_1) org.stripe_id = TEST_STRIPE_ID diff --git a/static/js/app.js b/static/js/app.js index 302ffeaea..57a012a44 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -225,6 +225,19 @@ quayApp = angular.module('quay', ['ngRoute', 'chieffancypants.loadingBar', 'angu }; dataFileService.tryAsTarGz_ = function(buf, success, failure) { + var collapsePath = function(originalPath) { + // Tar files can contain entries of the form './', so we need to collapse + // those paths down. + var parts = originalPath.split('/'); + for (var i = parts.length - 1; i >= 0; i--) { + var part = parts[i]; + if (part == '.') { + parts.splice(i, 1); + } + } + return parts.join('/'); + }; + var gunzip = new Zlib.Gunzip(buf); var plain = gunzip.decompress(); @@ -239,9 +252,13 @@ quayApp = angular.module('quay', ['ngRoute', 'chieffancypants.loadingBar', 'angu var files = []; for (var i = 0; i < handler.files.length; ++i) { var currentFile = handler.files[i]; + var path = collapsePath(currentFile.filename); + + if (path == '') { continue; } + files.push({ - 'name': dataFileService.getName_(currentFile.filename), - 'path': currentFile.filename, + 'name': dataFileService.getName_(path), + 'path': path, 'canRead': true, 'toBlob': (function(currentFile) { return function() { diff --git a/test/data/test.db b/test/data/test.db index 38f50c490..af529991c 100644 Binary files a/test/data/test.db and b/test/data/test.db differ