Skip to content

Commit

Permalink
fix: translatability (#24553)
Browse files Browse the repository at this point in the history
(cherry picked from commit 9fa409e)

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
  • Loading branch information
mergify[bot] and barredterra committed Jan 28, 2024
1 parent 44ec1e3 commit 41d2fe2
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 All @@ -29,14 +30,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 41d2fe2

Please sign in to comment.