# HG changeset patch # User bsw # Date 1449235543 -3600 # Node ID 7f818548b7b871c47c9c1536bca056447d5eb1ab # Parent 8288027edb5407e328ba6e8634876243143992e3 Added push grace period for verification phase to lf4rcs diff -r 8288027edb54 -r 7f818548b7b8 config/example.lua --- a/config/example.lua Fri Dec 04 14:19:28 2015 +0100 +++ b/config/example.lua Fri Dec 04 14:25:43 2015 +0100 @@ -360,6 +360,10 @@ } +-- Grace period after creating an initiative for pushing changes during verification phase +-- disabled by default (nil), use PostgreSQL interval notation +-- config.lf4rcs.push_grace_period = nil + lf4rcs.init() --]] diff -r 8288027edb54 -r 7f818548b7b8 env/lf4rcs/update_references.lua --- a/env/lf4rcs/update_references.lua Fri Dec 04 14:19:28 2015 +0100 +++ b/env/lf4rcs/update_references.lua Fri Dec 04 14:25:43 2015 +0100 @@ -69,7 +69,23 @@ abort("initiative belongs to another unit (unit ID " .. initiative.issue.area.unit_id .. ")") end if initiative.issue.state ~= "admission" and initiative.issue.state ~= "discussion" then - abort("issue is already frozen or closed (" .. initiative.issue.state .. ")") + if initiative.issue.state == "verification" then + if config.lf4rcs.push_grace_period + local in_push_grace_period = Initiative:new_selector() + :reset_fields() + :add_field({ "now() - initiative.created_at <= ?", config.lf4rcs.push_grace_period }, "in_push_grace_period") + :add_where{ "id = ?", initiative.id } + :single_object_mode() + :exec()).in_push_grace_period + if not in_push_period then + abort("issue is already frozen and the push grace period is expired") + end + else + abort("issue is already frozen") + end + else + abort("issue is already closed (" .. initiative.issue.state .. ")") + end end if initiative.revoked then abort("initiative has been revoked")