liquid_feedback_frontend
changeset 1353:77b023835c2d
Update unit privileges during registration update part2
author | bsw |
---|---|
date | Mon Aug 06 13:32:28 2018 +0200 (2018-08-06) |
parents | 07e320676bf3 |
children | 995f3096cb2a |
files | app/main/registration_admin/_action/update_verification.lua |
line diff
1.1 --- a/app/main/registration_admin/_action/update_verification.lua Mon Aug 06 13:27:22 2018 +0200 1.2 +++ b/app/main/registration_admin/_action/update_verification.lua Mon Aug 06 13:32:28 2018 +0200 1.3 @@ -11,10 +11,12 @@ 1.4 value = string.gsub(value, "[^0-9]", "") 1.5 elseif field.name == "unit" then 1.6 value = string.gsub(value, "[^0-9]", "") 1.7 - if verification.verification_data.unit and value ~= verification.verification_data.unit then 1.8 - local old_unit_privilege = Privilege:by_pk(verification.verified_member_id, verification.verification_data.unit) 1.9 - old_unit_privilege:destroy() 1.10 - unit_privilege = Privilege:new() 1.11 + if value ~= verification.verification_data.unit then 1.12 + if verification.verification_data.unit then 1.13 + local old_unit_privilege = Privilege:by_pk(verification.verified_member_id, verification.verification_data.unit) 1.14 + old_unit_privilege:destroy() 1.15 + end 1.16 + local unit_privilege = Privilege:new() 1.17 unit_privilege.member_id = verification.verified_member_id 1.18 unit_privilege.unit_id = verification.verification_data.unit 1.19 unit_privilege.voting_right = true