liquid_feedback_frontend
diff app/main/initiative/_action/create.lua @ 64:3ec1dea6eefb
Bug when creating alternative initiatives fixed; Policy list link only shown when creating new issue
| author | bsw | 
|---|---|
| date | Thu Apr 22 17:05:18 2010 +0200 (2010-04-22) | 
| parents | 88ac7798b562 | 
| children | 134fce4bede3 | 
   line diff
1.1 --- a/app/main/initiative/_action/create.lua Thu Apr 22 16:29:07 2010 +0200 1.2 +++ b/app/main/initiative/_action/create.lua Thu Apr 22 17:05:18 2010 +0200 1.3 @@ -33,19 +33,7 @@ 1.4 end 1.5 end 1.6 1.7 -local policy_id = param.get("policy_id", atom.integer) 1.8 1.9 -if policy_id == -1 then 1.10 - slot.put_into("error", _"Please choose a policy") 1.11 - return false 1.12 -end 1.13 - 1.14 -local policy = Policy:by_id(policy_id) 1.15 - 1.16 -if not policy.active then 1.17 - slot.put_into("error", "Invalid policy.") 1.18 - return false 1.19 -end 1.20 1.21 local name = param.get("name") 1.22 1.23 @@ -59,6 +47,16 @@ 1.24 local initiative = Initiative:new() 1.25 1.26 if not issue then 1.27 + local policy_id = param.get("policy_id", atom.integer) 1.28 + if policy_id == -1 then 1.29 + slot.put_into("error", _"Please choose a policy") 1.30 + return false 1.31 + end 1.32 + local policy = Policy:by_id(policy_id) 1.33 + if not policy.active then 1.34 + slot.put_into("error", "Invalid policy.") 1.35 + return false 1.36 + end 1.37 if not area:get_reference_selector("allowed_policies") 1.38 :add_where{ "policy.id = ?", policy_id } 1.39 :optional_object_mode()