pepkit / pepdbagent

Database for storing sample metadata
BSD 2-Clause "Simplified" License
2 stars 1 forks source link

`User` shouldn't be a required argument #48

Closed nleroy917 closed 1 year ago

nleroy917 commented 1 year ago

I pulled the latest version of pepdbagent and I am noticing that when not logged in, a lot of endpoints start failing. The errors usually take a form that looks like this:

TypeError: get_namespace_info() missing 2 required positional arguments: 'user' and 'user_organizations'

I think that these should be optional and default to None. I envision pephub, the majority of the time, will be run unauthenticated and thus should be able to elegantly handle cases where a user param is not passed in.

I think the fix should be simple as when I manually pass in None things seem to work well.

nsheff commented 1 year ago

I agree with the idea that None would be a sensible default for these kind of things that would be populated when logged in.

We should expect that things aren't logged in and respond accordingly.