Commit 3e312658 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Bugfix: featured elections were added at each server startup

parent 63e096c6
...@@ -156,12 +156,6 @@ module Make (C : CONFIG) : SITE = struct ...@@ -156,12 +156,6 @@ module Make (C : CONFIG) : SITE = struct
let module X : EMPTY = R.Register (S) (T) in let module X : EMPTY = R.Register (S) (T) in
let election = (module W : WEB_ELECTION) in let election = (module W : WEB_ELECTION) in
election_table := SMap.add uuid election !election_table; election_table := SMap.add uuid election !election_table;
lwt () =
if W.featured then (
lwt the_featured = Ocsipersist.get featured in
Ocsipersist.set featured (uuid :: the_featured)
) else return ()
in
return election return election
let () = import_election_ref := fun featured f -> let () = import_election_ref := fun featured f ->
...@@ -201,6 +195,10 @@ module Make (C : CONFIG) : SITE = struct ...@@ -201,6 +195,10 @@ module Make (C : CONFIG) : SITE = struct
Ocsipersist.add election_ptable uuid (raw_election, web_params) >> Ocsipersist.add election_ptable uuid (raw_election, web_params) >>
lwt election = register_election params web_params in lwt election = register_election params web_params in
let module W = (val election : WEB_ELECTION) in let module W = (val election : WEB_ELECTION) in
lwt () =
if W.featured then S.add_featured_election uuid
else return ()
in
begin try_lwt begin try_lwt
let () = let () =
Ocsigen_messages.debug (fun () -> Ocsigen_messages.debug (fun () ->
......
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