Tweak: improve tag parent validation error handling (#11096)

This commit is contained in:
shamoon
2025-10-20 22:42:01 -07:00
committed by GitHub
parent a206ac78dd
commit fcae006afa
3 changed files with 4 additions and 4 deletions

View File

@@ -132,7 +132,7 @@ class Tag(MatchingModel, TreeNodeModel):
height = 0 if self.pk is None else self.get_depth()
deepest_new_depth = (new_parent_depth + 1) + height
if deepest_new_depth > self.MAX_NESTING_DEPTH:
raise ValidationError(_("Maximum nesting depth exceeded."))
raise ValidationError({"parent": _("Maximum nesting depth exceeded.")})
return super().clean()