# HG changeset patch # User bsw # Date 1330204838 -3600 # Node ID d39fa6c0ff0b6e8f108feff7b69ae6daa2988885 # Parent fac04b72bc9a63ed016d4076e27c1f65ced1ca68 Check voting right of delegation trustee diff -r fac04b72bc9a -r d39fa6c0ff0b app/main/delegation/_action/update.lua --- a/app/main/delegation/_action/update.lua Sat Feb 25 21:19:12 2012 +0100 +++ b/app/main/delegation/_action/update.lua Sat Feb 25 22:20:38 2012 +0100 @@ -33,6 +33,8 @@ end else + + local trustee = Member:by_id(trustee_id) local check_unit_id if unit_id then @@ -45,6 +47,11 @@ local area = Area:by_id(issue.area_id) check_unit_id = area.unit_id end + + if not trustee:has_voting_right_for_unit_id(check_unit_id) then + slot.put_into("error", _"Trustee has no voting right in this unit") + return false + end if not app.session.member:has_voting_right_for_unit_id(check_unit_id) then error("access denied")