Commit 618c1813 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Fix client and cast service (somehow)

Ballot hashes do not agree, but we'll see later.
parent 17df1e3f
......@@ -166,6 +166,7 @@ BOOTH.setup_election = function(raw_json) {
// the main reason for this is unicode representation: the Python approach
// appears to be safer.
BOOTH.election = HELIOS.Election.fromJSONString(raw_json);
BOOTH.election.cast_url = "/election/cast?uuid=" + BOOTH.election.uuid
// FIXME: we shouldn't need to set both, but right now we are doing so
// because different code uses each one. Bah. Need fixing.
......
......@@ -2,9 +2,9 @@ open Util
open Serializable_t
open Lwt
(* The following should be in configuration file... but
(* FIXME: the following should be in configuration file... but
<maxrequestbodysize> doesn't work *)
let () = Ocsigen_config.set_maxrequestbodysizeinmemory 32768
let () = Ocsigen_config.set_maxrequestbodysizeinmemory 128000
let elections_table = Ocsipersist.open_table "elections"
......@@ -173,7 +173,7 @@ let () = Eliom_registration.Html5.register
x.trustee_public_key
) election.Common.public_keys
let params = { election.Common.election with e_public_key = y }
let fingerprint = assert false
let fingerprint = election.Common.fingerprint
end in
let module M = Election.MakeSimpleMonad(P.G) in
let module E = Election.MakeElection(P)(M) in
......@@ -182,7 +182,7 @@ let () = Eliom_registration.Html5.register
E.check_ballot ballot
then `Valid (Common.hashB raw_ballot)
else `Invalid
with e -> `Malformed
with e -> `Malformed e
in
Templates.cast_ballot ~election ~result
)
......
......@@ -378,7 +378,7 @@ let cast_ballot ~election ~result =
(match result with
| `Valid hash -> pcdata (" is valid, its hash is " ^ hash)
| `Invalid -> pcdata " is invalid!"
| `Malformed -> pcdata " is malformed!"
| `Malformed e -> Printf.ksprintf pcdata " is malformed! (%s)" (Printexc.to_string e)
);
]
] in base ~title ~header:[] ~content
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