summaryrefslogtreecommitdiff
path: root/django/contrib/postgres/utils.py
diff options
context:
space:
mode:
authorMattias Loverot <mattias@stubin.se>2016-08-16 12:07:03 +0200
committerTim Graham <timograham@gmail.com>2016-08-25 16:12:40 -0400
commit2315114090815aed72be2b9bc936d7b6374f12fc (patch)
tree6caf23c46dfc24c499fb624a729058973c1e2ef6 /django/contrib/postgres/utils.py
parent13c3e5d5a05e9c358d212d154addd703cac3bc66 (diff)
downloaddjango-2315114090815aed72be2b9bc936d7b6374f12fc.tar.gz
Fixed #27067 -- Deprecated string_concat() in favor of format_lazy().
Diffstat (limited to 'django/contrib/postgres/utils.py')
-rw-r--r--django/contrib/postgres/utils.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/django/contrib/postgres/utils.py b/django/contrib/postgres/utils.py
index 1563149c7e..a2bbb72f36 100644
--- a/django/contrib/postgres/utils.py
+++ b/django/contrib/postgres/utils.py
@@ -2,7 +2,7 @@ from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.utils.functional import SimpleLazyObject
-from django.utils.translation import string_concat
+from django.utils.text import format_lazy
def prefix_validation_error(error, prefix, code, params):
@@ -15,10 +15,11 @@ def prefix_validation_error(error, prefix, code, params):
return ValidationError(
# We can't simply concatenate messages since they might require
# their associated parameters to be expressed correctly which
- # is not something `string_concat` does. For example, proxied
+ # is not something `format_lazy` does. For example, proxied
# ungettext calls require a count parameter and are converted
# to an empty string if they are missing it.
- message=string_concat(
+ message=format_lazy(
+ '{}{}',
SimpleLazyObject(lambda: prefix % params),
SimpleLazyObject(lambda: error.message % error_params),
),