-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Several (Pygrister) apis don't expose a "team_id" parameter to allow changing the org/team id at runtime. Internally, they simply rely on "self.configurator.server" to construct the required url.
In fact, the equivalent Grist apis tend to be rather lenient: https://myteam.getgrist.com/api/profile/apikey will work, but https://bogus.getgrist.com/api/profile/apikey will work too :-/
However, Grist may become stricter in future and, even now, calling inspect() and finding out that we called a different url than expected may confuse the user.
For consistency, we should always expose a "team_id" argument, even if it is not necessary. Each function that now works like this:
def foo(self, ...):
url = f'{self.configurator.server}/...'
should work like
def foo(self, ..., team_id=''):
url = f'{self.configurator.make_server(team_id)}/...'
instead.
OR, all of this is actually wrong and we shouldn't offer a parameter that is not actually needed?
(besides, the opposite would be tricky too... removing the team_id parameter every time it's not actually needed in the underlying Grist api... ugh)