liquid_feedback_frontend
diff env/lf4rcs/update_references.lua @ 1235:7f818548b7b8
Added push grace period for verification phase to lf4rcs
author | bsw |
---|---|
date | Fri Dec 04 14:25:43 2015 +0100 (2015-12-04) |
parents | 30523f31b186 |
children | 4204e1185f66 |
line diff
1.1 --- a/env/lf4rcs/update_references.lua Fri Dec 04 14:19:28 2015 +0100 1.2 +++ b/env/lf4rcs/update_references.lua Fri Dec 04 14:25:43 2015 +0100 1.3 @@ -69,7 +69,23 @@ 1.4 abort("initiative belongs to another unit (unit ID " .. initiative.issue.area.unit_id .. ")") 1.5 end 1.6 if initiative.issue.state ~= "admission" and initiative.issue.state ~= "discussion" then 1.7 - abort("issue is already frozen or closed (" .. initiative.issue.state .. ")") 1.8 + if initiative.issue.state == "verification" then 1.9 + if config.lf4rcs.push_grace_period 1.10 + local in_push_grace_period = Initiative:new_selector() 1.11 + :reset_fields() 1.12 + :add_field({ "now() - initiative.created_at <= ?", config.lf4rcs.push_grace_period }, "in_push_grace_period") 1.13 + :add_where{ "id = ?", initiative.id } 1.14 + :single_object_mode() 1.15 + :exec()).in_push_grace_period 1.16 + if not in_push_period then 1.17 + abort("issue is already frozen and the push grace period is expired") 1.18 + end 1.19 + else 1.20 + abort("issue is already frozen") 1.21 + end 1.22 + else 1.23 + abort("issue is already closed (" .. initiative.issue.state .. ")") 1.24 + end 1.25 end 1.26 if initiative.revoked then 1.27 abort("initiative has been revoked")