~quickshotdevs/quickshot/server

« back to all changes in this revision

Viewing changes to quickshot/lib/helpers.py

  • Committer: Neil Tallim
  • Date: 2010-09-29 00:35:37 UTC
  • Revision ID: flan@stellvia-20100929003537-g1rcrvh2wncqhdqc
Fixed an issue with 500s stemming from projects with an incomplete direcotry structure.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
            return preferred_path
59
59
            
60
60
    base_path = get_screenshots_base_path(project_details)
 
61
    if not os.path.isdir(base_path):
 
62
        return None
61
63
    candidates = [os.path.join(base_path, language, config['quickshot.data_state_accepted'], screenshot_filename) for language in os.listdir(base_path)]
62
64
    random.shuffle(candidates)
63
65
    for candidate in candidates: