Skip to content

Commit

Permalink
Merge pull request #31 from maykinmedia/feature/oz-1256-validation-id…
Browse files Browse the repository at this point in the history
…-in-error

✨ add identificatie to UniekeIdentificatieValidator error nessage
  • Loading branch information
Coperh authored Jul 5, 2024
2 parents ed4f335 + 5c9cb4d commit 4ea0638
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions vng_api_common/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class UniekeIdentificatieValidator:
:param identificatie_field: naam van het veld dat de identificatie bevat
"""

message = _("Deze identificatie bestaat al binnen de organisatie")
message = _("Deze identificatie ({identificatie}) bestaat al binnen de organisatie")
code = "identificatie-niet-uniek"
requires_context = True

Expand Down Expand Up @@ -345,7 +345,12 @@ def __call__(self, attrs: dict, serializer):

if combination_exists:
raise serializers.ValidationError(
{self.identificatie_field: self.message}, code=self.code
{
self.identificatie_field: self.message.format(
identificatie=identificatie
)
},
code=self.code,
)


Expand Down

0 comments on commit 4ea0638

Please sign in to comment.