From 1a01e017ad8d20b4b98c828890c6561eb33a18aa Mon Sep 17 00:00:00 2001 From: Tim Lister Date: Wed, 18 Oct 2023 20:14:04 -0700 Subject: [PATCH] Test if the passed thing is a Body in a more pythonic way --- neoexchange/core/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neoexchange/core/views.py b/neoexchange/core/views.py index 0dd43ac48..8242fd842 100644 --- a/neoexchange/core/views.py +++ b/neoexchange/core/views.py @@ -4641,7 +4641,7 @@ def compare_NEOx_horizons_ephems(body, d, sitecode='500', debug=True): of the separation (as Astropy Angle instances in u.arcsec in the sense of the values that need to be added to the NEOx position to the HORIZONS one)""" - if type(body) != Body: + if hasattr(body, 'name') is False: body = Body.objects.get(name=body) neox_emp = compute_ephem(d, model_to_dict(body), sitecode, perturb=True, display=debug)