summaryrefslogtreecommitdiff
path: root/tbc
diff options
context:
space:
mode:
authorhardythe12014-03-13 15:33:51 +0530
committerhardythe12014-03-13 15:33:51 +0530
commit44f187cd9a1f47df1e526dacc634838dc7485abb (patch)
tree30ec947bc18a4b96ae5c8b7646b5211856c258f9 /tbc
parent6191d17041db1e1bebd5406b22ee4d9f4fd7e6ec (diff)
downloadPython-TBC-Interface-44f187cd9a1f47df1e526dacc634838dc7485abb.tar.gz
Python-TBC-Interface-44f187cd9a1f47df1e526dacc634838dc7485abb.tar.bz2
Python-TBC-Interface-44f187cd9a1f47df1e526dacc634838dc7485abb.zip
replacing spaces with underscores in filenames
Diffstat (limited to 'tbc')
-rw-r--r--tbc/models.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tbc/models.py b/tbc/models.py
index e663ec0..4465a4d 100644
--- a/tbc/models.py
+++ b/tbc/models.py
@@ -39,11 +39,11 @@ ABOUT_PROJ = (("pythontbc website", "Python TBC Website"),
("others", "Others"))
def get_notebook_dir(instance, filename):
- return '%s/%s/%s' % (instance.book.contributor, instance.book.title.replace(' ', '_'), filename)
+ return '%s/%s/%s' % (instance.book.contributor, instance.book.title.replace(' ', '_'), filename.replace(' ', '_'))
def get_image_dir(instance, filename):
- return '%s/%s/screenshots/%s' % (instance.book.contributor, instance.book.title.replace(' ', '_'), filename)
+ return '%s/%s/screenshots/%s' % (instance.book.contributor, instance.book.title.replace(' ', '_'), filename.replace(' ', '_'))
class Profile(models.Model):