Skip to content

Commit

Permalink
Fix prefix replace.
Browse files Browse the repository at this point in the history
  • Loading branch information
hellysmile committed Nov 4, 2015
1 parent ea5bbfe commit 477ec60
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions redis_sessions_fork/utils.py
Expand Up @@ -27,9 +27,12 @@ def add_prefix(key):

def remove_prefix(key):
if settings.SESSION_REDIS_PREFIX:
key = str(key).replace(
'%s:' % settings.SESSION_REDIS_PREFIX, '', 1
)
key = str(key)

if key.startswith(settings.SESSION_REDIS_PREFIX):
key = key.replace(
'%s:' % settings.SESSION_REDIS_PREFIX, '', 1
)

return key

Expand Down

0 comments on commit 477ec60

Please sign in to comment.