Skip to content

Commit

Permalink
[#233] Change PartijIdentificatorValidator call
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmursa-dev committed Dec 30, 2024
1 parent c2a194c commit 9c92fc6
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 156 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,16 @@ class Meta:

def validate(self, attrs):
partij_identificator = get_field_value(self, attrs, "partij_identificator")
PartijIdentificatorValidator(**partij_identificator).validate()
PartijIdentificatorValidator(
code_register=partij_identificator["partij_identificator_code_register"],
code_objecttype=partij_identificator[
"partij_identificator_code_objecttype"
],
code_soort_object_id=partij_identificator[
"partij_identificator_code_soort_object_id"
],
object_id=partij_identificator["partij_identificator_object_id"],
).validate()
return super().validate(attrs)

@transaction.atomic
Expand Down
7 changes: 6 additions & 1 deletion src/openklant/components/klantinteracties/models/partijen.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,4 +420,9 @@ def save(self, *args, **kwargs):

def clean(self):
super().clean()
PartijIdentificatorValidator(**self.partij_identificator).validate()
PartijIdentificatorValidator(
code_register=self.partij_identificator_code_register,
code_objecttype=self.partij_identificator_code_objecttype,
code_soort_object_id=self.partij_identificator_code_soort_object_id,
object_id=self.partij_identificator_object_id,
).validate()
Loading

0 comments on commit 9c92fc6

Please sign in to comment.