Skip to content

Commit

Permalink
feat: LAN-766
Browse files Browse the repository at this point in the history
  • Loading branch information
diePuppe committed Jun 28, 2023
1 parent eb2888d commit 329a710
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,15 @@ def is_inactive(self):


def validate_unique_roles(self):
unique_roles = ["1. Vorsitzender Verein", "2. Vorsitzender Verein", "Schatzmeister"]
unique_roles = frappe.get_value(
"Member Function Category", self.member_function_category, "only_one_per_organization"
)

member_function_category_name = frappe.get_value(
"Member Function Category", self.member_function_category, "name"
)

if member_function_category_name in unique_roles:
if unique_roles == 1:
existing_member_functions = frappe.get_all(
"Member Function",
filters={
Expand All @@ -123,7 +125,7 @@ def validate_unique_roles(self):
if existing_member_functions:
frappe.throw(
_(
"The function category {0} can only be assigned once per member in the same organization."
"The function category can only be assigned once per member in the same organization."
).format(member_function_category_name)
)

Expand Down

0 comments on commit 329a710

Please sign in to comment.