Skip to content

Commit

Permalink
Applied Martin Kleppmann's patch: "[PATCH] Fix error in backup direct…
Browse files Browse the repository at this point in the history
…ory search

If the gaebar/backups directory contains subdirectories other than
ones starting with backup_*, the 'init' view blows up. This patch
fixes the issue, ignoring subdirectories which do not start with
'backup_'."
  • Loading branch information
aral committed Jan 20, 2009
1 parent 98415f1 commit 7cb964e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion views.py
Expand Up @@ -261,7 +261,11 @@ def index(request):
for i in range(len(folders)):
if i == 0: continue
num_files = len(folders[i])
folder_name_index = folder_names[i].index('backup_')
try:
folder_name_index = folder_names[i].index('backup_')
except ValueError:
continue # It's some other folder, not a backup

folder_name = folder_names[i][folder_name_index:]

# TODO: We need to store host information for backups with the backup
Expand Down

0 comments on commit 7cb964e

Please sign in to comment.