Skip to content

Commit 24a6d3f

Browse files
candleindarkCopilot
andcommitted
docs: correct the docstring for dandi_authenticate
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 84be13a commit 24a6d3f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

dandi/dandiapi.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -487,12 +487,13 @@ def dandi_authenticate(self) -> None:
487487
"""
488488
Acquire and set the authentication token/API key used by the
489489
`DandiAPIClient`.
490-
If the :envvar:`f"{self.dandi_instance.name.upper().replace('-', '_')}_API_KEY"`
491-
environment variable is set, its value is used as the token. Otherwise,
492-
the token is looked up in the user's keyring under the service
493-
":samp:`dandi-api-{self.dandi_instance.name}`" [#auth]_ and username "``key``".
494-
If no token is found there, the user is prompted for the token, and, if
495-
it proves to be valid, it is stored in the user's keyring.
490+
If the :envvar:`{INSTANCE_NAME}_API_KEY` environment variable is set, its value
491+
is used as the token. Here, ``{INSTANCE_NAME}`` is the uppercased instance name
492+
with hyphens replaced by underscores. Otherwise, the token is looked up in the
493+
user's keyring under the service ":samp:`dandi-api-{self.dandi_instance.name}`"
494+
[#auth]_ and username "``key``". If no token is found there, the user is
495+
prompted for the token, and, if it proves to be valid, it is stored in the
496+
user's keyring.
496497
497498
.. [#auth] E.g., "``dandi-api-dandi``" for the production server or
498499
"``dandi-api-dandi-sandbox``" for the sandbox server

0 commit comments

Comments
 (0)