From 28ba00fa5c43fb13e9250220789c1c3598197f86 Mon Sep 17 00:00:00 2001 From: "Adam Ginsburg (keflavich)" Date: Fri, 12 Jan 2018 11:36:14 -0700 Subject: [PATCH] raise an error when attempting to download private data without first logging in --- astroquery/alma/core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/astroquery/alma/core.py b/astroquery/alma/core.py index 67d9d2a469..4e8578e5e9 100644 --- a/astroquery/alma/core.py +++ b/astroquery/alma/core.py @@ -287,6 +287,9 @@ def stage_data(self, uids): timeout=self.TIMEOUT, cache=False) self._staging_log['initial_response'] = response log.debug("First response URL: {0}".format(response.url)) + if 'login' in response.url: + raise ValueError("You must login before downloading this data set.") + if response.status_code == 405: if hasattr(self, '_last_successful_staging_log'): log.warning("Error 405 received. If you have previously staged "