Commit 3bcb21f1 authored by Stephane Glondu's avatar Stephane Glondu

Bugfix: elections were never removed from setup table

parent 8156fab4
...@@ -451,7 +451,7 @@ let () = ...@@ -451,7 +451,7 @@ let () =
let election_setup_mutex = Lwt_mutex.create () 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 -> with_site_user (fun u ->
let uuid_s = Uuidm.to_string uuid in let uuid_s = Uuidm.to_string uuid in
Lwt_mutex.with_lock election_setup_mutex (fun () -> Lwt_mutex.with_lock election_setup_mutex (fun () ->
...@@ -459,7 +459,7 @@ let with_setup_election uuid f = ...@@ -459,7 +459,7 @@ let with_setup_election uuid f =
if se.se_owner = u then ( if se.se_owner = u then (
try%lwt try%lwt
let%lwt r = f se in let%lwt r = f se in
let%lwt () = set_setup_election uuid_s se in let%lwt () = if save then set_setup_election uuid_s se else return_unit in
return r return r
with e -> with e ->
let service = preapply election_setup uuid in let service = preapply election_setup uuid in
...@@ -921,7 +921,7 @@ let () = ...@@ -921,7 +921,7 @@ let () =
let () = let () =
Any.register ~service:election_setup_create Any.register ~service:election_setup_create
(fun uuid () -> (fun uuid () ->
with_setup_election uuid (fun se -> with_setup_election ~save:false uuid (fun se ->
try%lwt try%lwt
let%lwt () = finalize_election uuid se in let%lwt () = finalize_election uuid se in
redir_preapply election_admin (uuid, ()) () 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