# HG changeset patch # User bsw # Date 1533555596 -7200 # Node ID 3b6575d156bcc0e4f95f4d65f5d8bcf51d54a8ae # Parent 761a7d6c3e5cf119261e90d0c4ea29e8865762d7 Fixed automatic unit assignment 2 diff -r 761a7d6c3e5c -r 3b6575d156bc app/main/registration_admin/_action/update_verification.lua --- a/app/main/registration_admin/_action/update_verification.lua Mon Aug 06 13:39:15 2018 +0200 +++ b/app/main/registration_admin/_action/update_verification.lua Mon Aug 06 13:39:56 2018 +0200 @@ -14,7 +14,9 @@ value = string.gsub(value, "[^0-9]", "") if old_verification_data.unit and old_verification_data.unit ~= "" then local old_unit_privilege = Privilege:by_pk(verification.verified_member_id, old_verification_data.unit) - old_unit_privilege:destroy() + if old_unit_privilege then + old_unit_privilege:destroy() + end end if value ~= old_verification_data.unit and value ~= "" then local unit_privilege = Privilege:new()