# HG changeset patch # User Stephanie Marcu # Date 1276673584 -7200 # Node ID ab03e4adb4f110d3c186810dd8b7c8f03dbaf0fb # Parent ca9e1c9123d756351f535cc36145e380fda9b08c [filefield] normalized file names to deal with windows files diff -r ca9e1c9123d7 -r ab03e4adb4f1 web/formfields.py --- a/web/formfields.py Wed Jun 16 09:30:30 2010 +0200 +++ b/web/formfields.py Wed Jun 16 09:33:04 2010 +0200 @@ -82,6 +82,8 @@ it """ +def normalize_filename(filename): + return filename.split('\\')[-1] def vocab_sort(vocab): """sort vocabulary, considering option groups""" @@ -736,7 +738,7 @@ value = None else: # set filename on the Binary instance, may be used later in hooks - value.filename = filename + value.filename = normalize_filename(filename) return value