# HG changeset patch # User bsw # Date 1427397307 -3600 # Node ID 9aab637c19ef4d82ed265ee655d189e5212166f2 # Parent d83ecd35458ca6e5052e37398dda71ca00ad2983 Fixed usage of a global variable diff -r d83ecd35458c -r 9aab637c19ef app/main/admin/_action/area_update.lua --- a/app/main/admin/_action/area_update.lua Thu Mar 26 20:13:39 2015 +0100 +++ b/app/main/admin/_action/area_update.lua Thu Mar 26 20:15:07 2015 +0100 @@ -20,7 +20,7 @@ } -- we have to update the default flag because update_relationship can't handle it -old_default = AllowedPolicy:new_selector() +local old_default = AllowedPolicy:new_selector() :add_where{ "allowed_policy.area_id = ? AND allowed_policy.default_policy = 't'", area.id } :optional_object_mode() :exec() @@ -30,10 +30,10 @@ old_default:save() end -default_policy_id = param.get("default_policy", atom.integer) +local default_policy_id = param.get("default_policy", atom.integer) if default_policy_id and default_policy_id ~= -1 then - pol = AllowedPolicy:new_selector() + local pol = AllowedPolicy:new_selector() :add_where{ "allowed_policy.area_id = ? AND allowed_policy.policy_id = ?", area.id, default_policy_id } :optional_object_mode() :exec()