Skip to content

Commit

Permalink
Merge pull request #24552 from barredterra/translatability-assignment…
Browse files Browse the repository at this point in the history
…-days
  • Loading branch information
barredterra committed Jan 26, 2024
2 parents 783cb78 + 9fa409e commit 0006f23
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions frappe/automation/doctype/assignment_rule/assignment_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from frappe.desk.form import assign_to
from frappe.model import log_types
from frappe.model.document import Document
from frappe.utils.data import comma_and


class AssignmentRule(Document):
Expand Down Expand Up @@ -55,14 +56,10 @@ def validate_document_types(self):

def validate_assignment_days(self):
assignment_days = self.get_assignment_days()

if len(set(assignment_days)) != len(assignment_days):
repeated_days = get_repeated(assignment_days)
plural = "s" if len(repeated_days) > 1 else ""

frappe.throw(
_("Assignment Day{0} {1} has been repeated.").format(
plural, frappe.bold(", ".join(repeated_days))
_("The following Assignment Days have been repeated: {0}").format(
comma_and([_(day) for day in get_repeated(assignment_days)], add_quotes=False)
)
)

Expand Down

0 comments on commit 0006f23

Please sign in to comment.