summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-02-27 09:28:02 -0500
committerTim Graham <timograham@gmail.com>2017-02-27 09:31:06 -0500
commit3a3145bfcd7a1de1e7cda2d3f2ba61a90d34cf11 (patch)
tree3774230b00c14c0b6d799b5cd58ce1d367b82440
parentc231e965e7eab56db8199d519813599a06e8ac8b (diff)
[1.11.x] Refs #27843 -- Fixed 'invalid escape sequence' warning in truncate_name().
Backport of 82026d61a383d07cd840a0d30443ee66bd99798b from master
-rw-r--r--django/db/backends/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/backends/utils.py b/django/db/backends/utils.py
index ce5e274649..ad87eb82e7 100644
--- a/django/db/backends/utils.py
+++ b/django/db/backends/utils.py
@@ -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: