I have a users table with:
id: number
username: unique string
password: string
email: unique string
first_name: string
last_name: string
...
Recently I tried to register with a user which has the same username as an already entered one and got an error. I tried to catch it as an IntegrityError exception but couldn't find any information regarding WHICH column is a duplicate in order to inform the user if it is the username, email or something else.
Is there any way to do this short of performing a query on all unique keys and seeing if they return something?