liquid_feedback_frontend
diff app/main/draft/_action/add.lua @ 1535:770ab0a7f79b
Added optional callback after creation of new draft
| author | bsw |
|---|---|
| date | Tue Oct 06 19:31:19 2020 +0200 (2020-10-06) |
| parents | ed3c40911ae1 |
| children | a13a0071f873 |
line diff
1.1 --- a/app/main/draft/_action/add.lua Mon Sep 14 18:31:20 2020 +0200 1.2 +++ b/app/main/draft/_action/add.lua Tue Oct 06 19:31:19 2020 +0200 1.3 @@ -390,13 +390,17 @@ 1.4 1.5 end 1.6 1.7 -print(new_initiative, status) 1.8 if new_initiative and status ~= false then 1.9 - request.redirect{ 1.10 - module = "initiative", 1.11 - view = "show", 1.12 - id = new_initiative.id 1.13 - } 1.14 + local callback = param.get("callback") 1.15 + if config.allow_new_draft_callback and callback then 1.16 + request.redirect{ external = callback } 1.17 + else 1.18 + request.redirect{ 1.19 + module = "initiative", 1.20 + view = "show", 1.21 + id = new_initiative.id 1.22 + } 1.23 + end 1.24 end 1.25 1.26 return status