Commit cba76337 authored by Stephane Glondu's avatar Stephane Glondu

Save whether the server is a trustee in metadata

parent c0d0e462
......@@ -98,6 +98,7 @@ let empty_metadata = {
e_trustees = None;
e_languages = None;
e_contact = None;
e_server_is_trustee = None;
}
let return_empty_metadata = return empty_metadata
......
......@@ -52,6 +52,7 @@ type metadata = {
?trustees : string list option;
?languages : string list option;
?contact : string option;
?server_is_trustee : bool option;
} <ocaml field_prefix="e_">
type election_dates = {
......
......@@ -169,7 +169,15 @@ let finalize_election uuid se =
return (y, Some trustees, `TP tp, `KEYS private_keys)
in
(* election parameters *)
let metadata = { se.se_metadata with e_trustees = trustees } in
let e_server_is_trustee = match private_keys with
| `KEY _ -> Some true
| `None | `KEYS _ -> None
in
let metadata = {
se.se_metadata with
e_trustees = trustees;
e_server_is_trustee;
} in
let template = se.se_questions in
let params = {
e_description = template.t_description;
......@@ -395,6 +403,7 @@ let create_new_election owner cred auth =
e_trustees = None;
e_languages = Some ["en"; "fr"];
e_contact = None;
e_server_is_trustee = None;
} in
let question = {
q_answers = [| "Answer 1"; "Answer 2"; "Answer 3" |];
......
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