mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-11-23 23:49:08 -06:00
Tweak: improve tag parent validation error handling (#11096)
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user