From e7033e00f8e1ba2ffe538e56c5088a7e94c2e45d Mon Sep 17 00:00:00 2001 From: Mads Jensen Date: Tue, 14 Mar 2017 13:29:22 +0100 Subject: [PATCH] Used constant instead of hard-coded value for max index name length Refs #26709 --- django/db/models/indexes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/models/indexes.py b/django/db/models/indexes.py index 7721826380c..1370463bebc 100644 --- a/django/db/models/indexes.py +++ b/django/db/models/indexes.py @@ -106,7 +106,7 @@ class Index: column_names[0][:7], '%s_%s' % (self._hash_generator(*hash_data), self.suffix), ) - assert len(self.name) <= 30, ( + assert len(self.name) <= MAX_NAME_LENGTH, ( 'Index too long for multiple database support. Is self.suffix ' 'longer than 3 characters?' )