Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
belenios
belenios
Commits
eeea7f74
Commit
eeea7f74
authored
Jan 21, 2013
by
Stephane Glondu
Browse files
get_election_by_uuid already raises 404 on error
parent
7150e808
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/helios_registration.ml
View file @
eeea7f74
...
...
@@ -117,11 +117,9 @@ let () = Eliom_registration.Redirection.register
let
()
=
Eliom_registration
.
String
.
register
~
service
:
Helios_services
.
election_raw
(
fun
uuid
()
->
try_lwt
lwt
election
=
get_election_by_uuid
uuid
in
return
(
election
.
Helios_templates
.
xelection
.
Common
.
raw
,
"application/json"
)
with
Not_found
->
raise_lwt
Eliom_common
.
Eliom_404
)
lwt
election
=
get_election_by_uuid
uuid
in
return
(
election
.
Helios_templates
.
xelection
.
Common
.
raw
,
"application/json"
)
)
let
()
=
Eliom_registration
.
String
.
register
~
service
:
Helios_services
.
get_randomness
...
...
@@ -136,19 +134,15 @@ let () = Eliom_registration.String.register
let
()
=
Eliom_registration
.
Html5
.
register
~
service
:
Helios_services
.
election_view
(
fun
uuid
()
->
try_lwt
lwt
election
=
get_election_by_uuid
uuid
in
Helios_templates
.
election_view
~
election
with
Not_found
->
raise_lwt
Eliom_common
.
Eliom_404
)
lwt
election
=
get_election_by_uuid
uuid
in
Helios_templates
.
election_view
~
election
)
let
()
=
Eliom_registration
.
Redirection
.
register
~
service
:
Helios_services
.
election_vote
(
fun
uuid
()
->
try_lwt
return
(
Helios_services
.
make_booth
uuid
)
with
Not_found
->
raise_lwt
Eliom_common
.
Eliom_404
)
return
(
Helios_services
.
make_booth
uuid
)
)
let
()
=
Eliom_registration
.
Redirection
.
register
~
service
:
Helios_services
.
election_cast
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment