core: add notice about duplicate keys

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-07-03 21:52:28 +02:00
parent 30033d1f90
commit bd92505bc2
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ def is_dict(value: Any):
"""Ensure a value is a dictionary, useful for JSONFields""" """Ensure a value is a dictionary, useful for JSONFields"""
if isinstance(value, dict): if isinstance(value, dict):
return return
raise ValidationError("Value must be a dictionary.") raise ValidationError("Value must be a dictionary, and not have any duplicate keys.")
class PassiveSerializer(Serializer): class PassiveSerializer(Serializer):

View File

@ -51,7 +51,7 @@ class OutpostSerializer(ModelSerializer):
raise ValidationError( raise ValidationError(
( (
f"Outpost type {self.initial_data['type']} can't be used with " f"Outpost type {self.initial_data['type']} can't be used with "
f"{type(provider)} providers." f"{provider.__class__.__name} providers."
) )
) )
return providers return providers