diff --git a/pandora/documentcollection/views.py b/pandora/documentcollection/views.py index cfe3e8f7..a678bd17 100644 --- a/pandora/documentcollection/views.py +++ b/pandora/documentcollection/views.py @@ -246,7 +246,7 @@ def addCollection(request, data): 'type' and 'view'. see: editCollection, findCollections, getCollection, removeCollection, sortCollections ''' - data['name'] = re.sub(' \[\d+\]$', '', data.get('name', 'Untitled')).strip() + data['name'] = re.sub(r' \[\d+\]$', '', data.get('name', 'Untitled')).strip() name = data['name'] if not name: name = "Untitled" diff --git a/pandora/edit/views.py b/pandora/edit/views.py index 4de8679d..c096b464 100644 --- a/pandora/edit/views.py +++ b/pandora/edit/views.py @@ -262,7 +262,7 @@ def addEdit(request, data): } see: editEdit, findEdit, getEdit, removeEdit, sortEdits ''' - data['name'] = re.sub(' \[\d+\]$', '', data.get('name', 'Untitled')).strip() + data['name'] = re.sub(r' \[\d+\]$', '', data.get('name', 'Untitled')).strip() name = data['name'] if not name: name = "Untitled" diff --git a/pandora/item/utils.py b/pandora/item/utils.py index fce7d724..83932967 100644 --- a/pandora/item/utils.py +++ b/pandora/item/utils.py @@ -61,7 +61,7 @@ def sort_title(title): title = sort_string(title) #title - title = re.sub('[\'!¿¡,\.;\-"\:\*\[\]]', '', title) + title = re.sub(r'[\'!¿¡,\.;\-"\:\*\[\]]', '', title) return title.strip() def get_positions(ids, pos, decode_id=False): diff --git a/pandora/itemlist/views.py b/pandora/itemlist/views.py index 82857d45..a55f5f04 100644 --- a/pandora/itemlist/views.py +++ b/pandora/itemlist/views.py @@ -242,7 +242,7 @@ def addList(request, data): 'type' and 'view'. see: editList, findLists, getList, removeList, sortLists ''' - data['name'] = re.sub(' \[\d+\]$', '', data.get('name', 'Untitled')).strip() + data['name'] = re.sub(r' \[\d+\]$', '', data.get('name', 'Untitled')).strip() name = data['name'] if not name: name = "Untitled" diff --git a/pandora/text/views.py b/pandora/text/views.py index 33338675..552db47f 100644 --- a/pandora/text/views.py +++ b/pandora/text/views.py @@ -39,7 +39,7 @@ def addText(request, data): } see: editText, findTexts, getText, removeText, sortTexts ''' - data['name'] = re.sub(' \[\d+\]$', '', data.get('name', 'Untitled')).strip() + data['name'] = re.sub(r' \[\d+\]$', '', data.get('name', 'Untitled')).strip() name = data['name'] if not name: name = "Untitled" diff --git a/pandora/urlalias/views.py b/pandora/urlalias/views.py index 9ed1a36c..541f61d8 100644 --- a/pandora/urlalias/views.py +++ b/pandora/urlalias/views.py @@ -64,7 +64,7 @@ def padma_video(request, url): except: return app.views.index(request) if view: - timecodes = re.compile('(\d{2}:\d{2}:\d{2}\.\d{3})-(\d{2}:\d{2}:\d{2}\.\d{3})').findall(view) + timecodes = re.compile(r'(\d{2}:\d{2}:\d{2}\.\d{3})-(\d{2}:\d{2}:\d{2}\.\d{3})').findall(view) if timecodes: view = ','.join(timecodes[0]) if view: diff --git a/pandora/user/views.py b/pandora/user/views.py index aa452cec..a2a678f1 100644 --- a/pandora/user/views.py +++ b/pandora/user/views.py @@ -914,7 +914,7 @@ def addGroup(request, data): created = False n = 1 name = data['name'] - _name = re.sub(' \[\d+\]$', '', name).strip() + _name = re.sub(r' \[\d+\]$', '', name).strip() while not created: g, created = Group.objects.get_or_create(name=name) n += 1 @@ -946,7 +946,7 @@ def editGroup(request, data): name = data['name'] n = 1 name = data['name'] - _name = re.sub(' \[\d+\]$', '', name).strip() + _name = re.sub(r' \[\d+\]$', '', name).strip() while Group.objects.filter(name=name).count(): n += 1 name = '%s [%d]' % (_name, n)