Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw error if current user is not found #52

Open
christoph-blessing opened this issue Feb 13, 2020 · 0 comments
Open

Throw error if current user is not found #52

christoph-blessing opened this issue Feb 13, 2020 · 0 comments
Milestone

Comments

@christoph-blessing
Copy link
Member

Right now the get_current_user method in the Fabrikant class returns None if it doesn't find an entry in the Fabrikant table corresponding to the current Datajoint username. This behavior of returning None can lead to non-helpful error messages in certain situations. For example trying to insert a dataset into the Dataset table without a matching entry being present in the Fabrikant table raises this error:

MissingAttributeError: Field 'dataset_fabrikant' doesn't have a default value

I propose to raise a more descriptive error in the get_current_user method if there is no matching entry found.

@ArneNx ArneNx added this to the Going Public milestone Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants