summaryrefslogtreecommitdiff
path: root/django/contrib/postgres/validators.py
diff options
context:
space:
mode:
authorNick Pope <nick.pope@flightdataservices.com>2017-12-11 12:08:45 +0000
committerTim Graham <timograham@gmail.com>2017-12-11 07:08:45 -0500
commitd13a9e44ded4e93570c6ba42ec84e45ddca2505b (patch)
tree0df16e6538d8794c39bd62b5a46879b8abe6572c /django/contrib/postgres/validators.py
parenta9e5ac823df8ba8b786b6450c967ca378c008d0e (diff)
downloaddjango-d13a9e44ded4e93570c6ba42ec84e45ddca2505b.tar.gz
Fixed #28909 -- Simplified code using tuple/list/set/dict unpacking.
Diffstat (limited to 'django/contrib/postgres/validators.py')
-rw-r--r--django/contrib/postgres/validators.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/django/contrib/postgres/validators.py b/django/contrib/postgres/validators.py
index 45bf8e1e13..db6205f356 100644
--- a/django/contrib/postgres/validators.py
+++ b/django/contrib/postgres/validators.py
@@ -1,5 +1,3 @@
-import copy
-
from django.core.exceptions import ValidationError
from django.core.validators import (
MaxLengthValidator, MaxValueValidator, MinLengthValidator,
@@ -37,8 +35,7 @@ class KeysValidator:
self.keys = set(keys)
self.strict = strict
if messages is not None:
- self.messages = copy.copy(self.messages)
- self.messages.update(messages)
+ self.messages = {**self.messages, **messages}
def __call__(self, value):
keys = set(value)