Skip to content

Commit 92bc314

Browse files
committed
minor tweaks attempting to get the error to go away... doesn't work
1 parent 6cf2bc0 commit 92bc314

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

astroquery/eso/core.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def _activate_form(self, response, form_index=0, inputs={}, cache=True,
127127

128128
if key in inputs:
129129
value = str(inputs[key])
130-
if (key is not None) and (value is not None):
130+
if (key is not None):# and (value is not None):
131131
if fmt == 'multipart/form-data':
132132
if is_file:
133133
payload.append(
@@ -136,6 +136,8 @@ def _activate_form(self, response, form_index=0, inputs={}, cache=True,
136136
if type(value) is list:
137137
for v in value:
138138
payload.append((key, ('', v)))
139+
elif value is None:
140+
payload.append((key, ('', '')))
139141
else:
140142
payload.append((key, ('', value)))
141143
else:
@@ -152,6 +154,8 @@ def _activate_form(self, response, form_index=0, inputs={}, cache=True,
152154
if method is not None:
153155
fmt = method
154156

157+
log.debug("Method/format = {0}".format(fmt))
158+
155159
# Send payload
156160
if fmt == 'get':
157161
response = self._request("GET", url, params=payload, cache=cache)
@@ -244,7 +248,7 @@ def list_instruments(self, cache=True):
244248
self._instrument_list.append(u'harps')
245249
return self._instrument_list
246250

247-
def query_surveys(self, surveys='any_collection_id', cache=True,
251+
def query_surveys(self, surveys='', cache=True,
248252
help=False, open_form=False, **kwargs):
249253
"""
250254
Query survey Phase 3 data contained in the ESO archive.
@@ -283,17 +287,6 @@ def query_surveys(self, surveys='any_collection_id', cache=True,
283287
else:
284288
query_dict["max_rows_returned"] = 10000
285289

286-
# missing entries:
287-
# filter: Any
288-
# tel_id: Any
289-
# ins_id: Any
290-
# obstech: Any
291-
# date_obs:
292-
# mjd_obs:
293-
# exptime:
294-
#
295-
# collection_name should be blank (?)
296-
297290
survey_response = self._activate_form(survey_form, form_index=0,
298291
inputs=query_dict, cache=cache)
299292

0 commit comments

Comments
 (0)