diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-04-16 10:27:03 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-04-16 10:27:03 -0500 |
commit | b0bfb766d95cf7eeed2c56aa7a84c496f5f5a6f2 (patch) | |
tree | aa85905d45eb477af1280e0e5f2286f542a8bf87 | |
parent | b1bb050b27e0a5d87e41b3228a394c8006ecce8e (diff) | |
download | mediagoblin-b0bfb766d95cf7eeed2c56aa7a84c496f5f5a6f2.tar.lz mediagoblin-b0bfb766d95cf7eeed2c56aa7a84c496f5f5a6f2.tar.xz mediagoblin-b0bfb766d95cf7eeed2c56aa7a84c496f5f5a6f2.zip |
when running get_unique_filepath, clean_listy_filepath from the get-go
-rw-r--r-- | mediagoblin/storage.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mediagoblin/storage.py b/mediagoblin/storage.py index 4dbb2cfd..d697276a 100644 --- a/mediagoblin/storage.py +++ b/mediagoblin/storage.py @@ -126,6 +126,10 @@ class StorageInterface(object): >>> storage_handler.get_unique_filename(['dir1', 'dir2', 'fname.jpg']) [u'dir1', u'dir2', u'd02c3571-dd62-4479-9d62-9e3012dada29-fname.jpg'] """ + # Make sure we have a clean filepath to start with, since + # we'll be possibly tacking on stuff to the filename. + filepath = clean_listy_filepath(filepath) + if self.file_exists(filepath): return filepath[:-1] + ["%s-%s" % (uuid.uuid4(), filepath[-1])] else: |