From aff6ddb6508f11cd7b6d17abac60d05ddc0e139b Mon Sep 17 00:00:00 2001 From: bnewbold Date: Fri, 1 Jun 2007 01:33:56 -0400 Subject: fixed slug method for quotes --- bn_django/git_wiki/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bn_django/git_wiki/models.py b/bn_django/git_wiki/models.py index 3023500..f0a7e9c 100644 --- a/bn_django/git_wiki/models.py +++ b/bn_django/git_wiki/models.py @@ -17,7 +17,7 @@ class Tree(models.Model): type = 'tree' def slug(self): #TODO: secure this - return ''.join(self.path.strip().lower().split()) + return ''.join(self.path.replace('"','').replace("'","").strip().lower().split()) class Admin: ordering = ['path','name'] @@ -72,7 +72,7 @@ class Item(models.Model): type='blob' def slug(self): #TODO: secure this - return ''.join(self.name.strip().lower().split()) + return ''.join(self.name.replace('"','').replace("'","").strip().lower().split()) class Admin: ordering = ['path','name'] @@ -173,7 +173,7 @@ def fromslug(reqslug): ret.reqslug = '/' return ret - reqslug = ''.join(reqslug.strip().lower().split()) + reqslug = ''.join(reqslug.replace('"','').replace("'","").strip().lower().split()) if reqslug[-1] == '/': reqslug=reqslug[:-1] itemtxt = commands.getoutput(GITPREFIX \ @@ -190,7 +190,7 @@ def fromslug(reqslug): fpath = ' '.join(words[3:]) if fpath[-1] == '/': fpath=fpath[:-1] - if ''.join(fpath.strip().lower().split()) == reqslug: + if ''.join(fpath.replace('"','').replace("'","").strip().lower().split()) == reqslug: hash = fhash path = fpath type = ftype -- cgit v1.2.3