That's true -- does the underlying stored procedure (or the function) for
adding kits return anything? If not, you could use that.


On Mon, Apr 21, 2014 at 7:15 PM, teravest <notifications@github.com> wrote:

> In www/americangut/add_participant.psp:
>
> > @@ -42,17 +43,23 @@ sql = "select cast(ag_login_id as varchar2(100)) from ag_login where email = '{0
> >  ag_login_id = ag_data_access.dynamicMetadataSelect(sql).fetchone()[0]
> >  sql = "select swabs_per_kit, verification_code from ag_handout_kits where kit_id = '{0}'".format(kit_id)
> >  swabs_per_kit, kit_verification_code = ag_data_access.dynamicMetadataSelect(sql).fetchone()
> > -ag_data_access.addAGKit(ag_login_id, kit_id, password, swabs_per_kit, kit_verification_code)
> > +try:
>
> The only thing about that is its not an atomic check. So if two people are
> trying to register the same kit on different computers. Its not very likely
> but I could see some kids, or an excited couple racing to get a kit
> registered. We could handle this by having agAddKit return true or false
> and have a try, except there...
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/qiime/qiime_web_app/pull/682/files#r11834452>
> .
>