Skip to content

Commit

Permalink
Test if the passed thing is a Body in a more pythonic way
Browse files Browse the repository at this point in the history
  • Loading branch information
talister committed Oct 19, 2023
1 parent ac1a48e commit 1a01e01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion neoexchange/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1a01e01

Please sign in to comment.