1
0
mirror of https://github.com/django/django.git synced 2025-03-25 08:40:45 +00:00

[1.11.x] Refs -- Fixed 'invalid escape sequence' warning in truncate_name().

Backport of 82026d61a383d07cd840a0d30443ee66bd99798b from master
This commit is contained in:
Tim Graham 2017-02-27 09:28:02 -05:00
parent c231e965e7
commit 3a3145bfcd

@ -186,7 +186,7 @@ def truncate_name(name, length=None, hash_len=4):
If a quote stripped name contains a username, e.g. USERNAME"."TABLE,
truncate the table portion only.
"""
match = re.match('([^"]+)"\."([^"]+)', name)
match = re.match(r'([^"]+)"\."([^"]+)', name)
table_name = match.group(2) if match else name
if length is None or len(table_name) <= length: