Open mpgh opened 3 months ago
Potential fix, check if username is empty and avoid calling run_tap lines 62, 63 i.e.
response = obs_control.fetch_pending_lco_requestgroups() pending_obs = obs_control.parse_lco_requestgroups(response)
related to this enhancement is also a suggestion to the exception handling, i.e. perhaps log the Exception via
except Exception as exception_message:
logger.warning('runTAP: Cannot perform TAP for target ' + event.name + ' ' + str(exception_message))
I added exception logging. In my local version of mop I have a my LCO username and a fake program number (LCO_USERNAME="kkruszynska", LCO_PROPOSAL_ID="KEY2023-aaaO"), which could be a "solution" to this problem.
When running MOP locally (branch dev) and running TAP using "python manage.py run_TAP all none" and without credentials in settings, the following error occurs:
"mop/toolbox/obs_control.py", line 33, in fetch_pending_lco_requestgroups "https://observe.lco.global/api/requestgroups/?state=PENDING&user=" + username) TypeError: can only concatenate str (not "NoneType") to str