Commit 4a7fdb15 authored by Stephane Glondu's avatar Stephane Glondu

Merge branch 'debug'

parents de9beb6b 3bcb21f1
......@@ -454,14 +454,14 @@ let () =
let election_setup_mutex = Lwt_mutex.create ()
let with_setup_election uuid f =
let with_setup_election ?(save = true) uuid f =
with_site_user (fun u ->
Lwt_mutex.with_lock election_setup_mutex (fun () ->
let%lwt se = get_setup_election uuid in
if se.se_owner = u then (
try%lwt
let%lwt r = f se in
let%lwt () = set_setup_election uuid se in
let%lwt () = if save then set_setup_election uuid se else return_unit in
return r
with e ->
let service = preapply election_setup uuid in
......@@ -915,7 +915,7 @@ let () =
let () =
Any.register ~service:election_setup_create
(fun uuid () ->
with_setup_election uuid (fun se ->
with_setup_election ~save:false uuid (fun se ->
try%lwt
let%lwt () = finalize_election uuid se in
redir_preapply election_admin (uuid, ()) ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment