Removed the unused validate_account_code validator from the accounting application.

This commit is contained in:
依瑪貓 2020-08-09 21:04:11 +08:00
parent c67bdb9be3
commit f64d72ea26

View File

@ -62,22 +62,3 @@ def validate_record_account_code(value):
if child is not None:
raise ValidationError(_("You cannot select a parent account."),
code="parent_account")
def validate_account_code(value):
"""Validates an account code.
Args:
value (str): The account code.
Raises:
ValidationError: When the validation fails.
"""
if len(value) > 1:
try:
Account.objects.get(code=value[:-1])
except Account.DoesNotExist:
raise ValidationError(
_("The parent account of this code does not exist."),
code="parent_not_exist")