cortex-lab / alyx

Database for experimental neuroscience laboratories
44 stars 11 forks source link

Fix failing autoname when new nickname already exists #771

Closed rossant closed 1 year ago

rossant commented 1 year ago

Fixing a bug reported by Charu today:

We are getting a 'server error 500' when trying to add animals to a litter for a specific breeding pair: Home -> litters -> (filter by line) Ai32cg x PVCre -> click on Ai32cg.Pv_L_053 -> now try to add any sex and save and we get the error.

The autoname logic was failing because the new nickname already existed. This fix just iterates the autoname until the new nickname doesn't already exist.