From 7655e9eea05012800a034197796bd536625b45b5 Mon Sep 17 00:00:00 2001 From: Ibrahim Awwal Date: Tue, 28 Aug 2012 22:38:56 -0700 Subject: [PATCH] Ensure that js files are returned in alphabetical order by django-pipeline. On most systems this seems to be the default behavior, but glob2.glob's order isn't guaranteed and on my machine the order seems to be random, which causes javascript which depends on include order to fail. --- lms/envs/common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lms/envs/common.py b/lms/envs/common.py index ce08bf9666..37d65e78f9 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -429,7 +429,7 @@ main_vendor_js = [ 'js/vendor/jquery.qtip.min.js', ] -discussion_js = glob2.glob(PROJECT_ROOT / 'static/coffee/src/discussion/*.coffee') +discussion_js = sorted(glob2.glob(PROJECT_ROOT / 'static/coffee/src/discussion/*.coffee')) # Load javascript from all of the available xmodules, and # prep it for use in pipeline js @@ -497,10 +497,10 @@ PIPELINE_JS = { 'source_filenames': [ pth.replace(COMMON_ROOT / 'static/', '') for pth - in glob2.glob(COMMON_ROOT / 'static/coffee/src/**/*.coffee') + in sorted(glob2.glob(COMMON_ROOT / 'static/coffee/src/**/*.coffee')) ] + [ pth.replace(PROJECT_ROOT / 'static/', '') - for pth in glob2.glob(PROJECT_ROOT / 'static/coffee/src/**/*.coffee')\ + for pth in sorted(glob2.glob(PROJECT_ROOT / 'static/coffee/src/**/*.coffee'))\ if pth not in courseware_only_js and pth not in discussion_js ] + [ 'js/form.ext.js',