- try
- match sth#fetch1 () with
- [ Some email; Some userid ] -> Some email, userid
- | [ None; Some userid ] -> None, userid
- | _ -> assert false
- with Not_found ->
- error ~title:"Already signed up"
- dbh hostid q "It looks like you have already used your invitation.";
- return () in
+ match rows with
+ | [ Some email, userid ] -> Some email, userid
+ | [ None, userid ] -> None, userid
+ | [] ->
+ error ~title:"Already signed up"
+ dbh hostid q "It looks like you have already used your invitation.";
+ return ()
+ | _ -> assert false in