Commit 92a8086a authored by Stephane Glondu's avatar Stephane Glondu

Election creation fails if passwords were not generated

parent 59020eed
...@@ -146,6 +146,18 @@ let import_election f = ...@@ -146,6 +146,18 @@ let import_election f =
| Some _ -> return_unit | Some _ -> return_unit
| None -> Lwt.fail (Failure "No voters") | None -> Lwt.fail (Failure "No voters")
in in
lwt () =
match metadata.e_auth_config with
| Some [x] ->
if x.auth_system = "password" then
let table = "password_" ^ underscorize uuid in
let table = Ocsipersist.open_table table in
lwt n = Ocsipersist.length table in
if n = 0 then Lwt.fail (Failure "No passwords")
else return_unit
else return_unit
| _ -> return_unit
in
lwt pks = Lwt_stream.( lwt pks = Lwt_stream.(
clone public_keys |> clone public_keys |>
map (trustee_public_key_of_string G.read) |> map (trustee_public_key_of_string G.read) |>
......
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