Skip to content

Commit 09ffe42

Browse files
Caesar connect respect connection env (#307)
* update caesar.py to respect panoptes connected endpoints when connecting to panoptes first * update caesar.py so that it does not use _local of Panoptes
1 parent d23d2b7 commit 09ffe42

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

panoptes_client/caesar.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,16 @@ class Caesar(object):
1919

2020
def __init__(
2121
self,
22-
endpoint='https://caesar.zooniverse.org',
22+
endpoint=None,
2323
redirect_url='https://caesar.zooniverse.org/auth/zooniverse/callback'
2424
):
25+
_default_endpoint = 'https://caesar.zooniverse.org'
26+
if Panoptes.client().endpoint == 'https://panoptes-staging.zooniverse.org':
27+
_default_endpoint = 'https://caesar-staging.zooniverse.org'
28+
29+
if endpoint is None:
30+
endpoint = _default_endpoint
31+
2532
self.endpoint = endpoint
2633
self.headers = {
2734
'Accept': 'application/json'

0 commit comments

Comments
 (0)