liquid_feedback_frontend
diff app/main/initiative/_action/create.lua @ 7:3941792e8be6
Version beta3
Table allowed_policy is respected while creating new issues
Broken vote now/later link is not shown anymore (until it's implemented)
More user friendly error page
Minor spelling error corrected
Table allowed_policy is respected while creating new issues
Broken vote now/later link is not shown anymore (until it's implemented)
More user friendly error page
Minor spelling error corrected
| author | bsw | 
|---|---|
| date | Sat Jan 02 12:00:00 2010 +0100 (2010-01-02) | 
| parents | 8d91bccab0bf | 
| children | 72c5e0ee7c98 | 
   line diff
1.1 --- a/app/main/initiative/_action/create.lua Sat Jan 02 12:00:00 2010 +0100 1.2 +++ b/app/main/initiative/_action/create.lua Sat Jan 02 12:00:00 2010 +0100 1.3 @@ -41,9 +41,17 @@ 1.4 local initiative = Initiative:new() 1.5 1.6 if not issue then 1.7 + local policy_id = param.get("policy_id", atom.integer) 1.8 + if not area:get_reference_selector("allowed_policies") 1.9 + :add_where{ "policy.id = ?", policy_id } 1.10 + :optional_object_mode() 1.11 + :exec() 1.12 + then 1.13 + error("policy not allowed") 1.14 + end 1.15 issue = Issue:new() 1.16 issue.area_id = area.id 1.17 - issue.policy_id = param.get("policy_id", atom.integer) 1.18 + issue.policy_id = policy_id 1.19 issue:save() 1.20 end 1.21