fixed bug in test_if_more_than_one_join

This commit is contained in:
David Kennedy 2024-01-05 06:36:03 -05:00
parent 185c1f0cb6
commit 3499cc3ba0
No known key found for this signature in database
GPG key ID: 6528A5386E66B96B

View file

@ -107,7 +107,7 @@ class RegistrarFormSet(forms.BaseFormSet):
# Raise a KeyError if rel is not a defined field on the db_obj model # Raise a KeyError if rel is not a defined field on the db_obj model
# This will help catch any errors in reverse_join config on forms # This will help catch any errors in reverse_join config on forms
if rel not in db_obj._meta.get_all_field_names(): if rel not in [field.name for field in db_obj._meta.get_fields()]:
raise KeyError(f"{rel} is not a defined field on the {db_obj._meta.model_name} model.") raise KeyError(f"{rel} is not a defined field on the {db_obj._meta.model_name} model.")
# if attr rel in db_obj is not None, then test if reference object(s) exist # if attr rel in db_obj is not None, then test if reference object(s) exist