From 09ffe42aed7fe77ca3c577a0cdd30a81290c8f6e Mon Sep 17 00:00:00 2001 From: yuenmichelle1 Date: Tue, 16 Apr 2024 11:36:36 -0500 Subject: [PATCH] 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 --- panoptes_client/caesar.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/panoptes_client/caesar.py b/panoptes_client/caesar.py index 272ad9df..5bc9fd84 100644 --- a/panoptes_client/caesar.py +++ b/panoptes_client/caesar.py @@ -19,9 +19,16 @@ class Caesar(object): def __init__( self, - endpoint='https://caesar.zooniverse.org', + endpoint=None, redirect_url='https://caesar.zooniverse.org/auth/zooniverse/callback' ): + _default_endpoint = 'https://caesar.zooniverse.org' + if Panoptes.client().endpoint == 'https://panoptes-staging.zooniverse.org': + _default_endpoint = 'https://caesar-staging.zooniverse.org' + + if endpoint is None: + endpoint = _default_endpoint + self.endpoint = endpoint self.headers = { 'Accept': 'application/json'