specify / specify7

Specify 7
https://www.specifysoftware.org/products/specify-7/
GNU General Public License v2.0
66 stars 36 forks source link

AttributeError when querying for stratigraphy tree ranks #5193

Closed lexiclevenger closed 2 months ago

lexiclevenger commented 3 months ago

Describe the bug An error is thrown when you attempt to query for Lithostratigraphy or Chronostratigraphy tree ranks in paleontology collections. I was able to reproduce this on the following databases: KUPaleoBot_2024_06_06, KUInvertPaleo_2024_06_06, KUEntomology_2024_06_06 (KUEntoFossil Collection), and bulgaria_iber_4_11_24 (Fossil Mammal, Paleobotany).

To Reproduce Steps to reproduce the behavior:

  1. In a paleo collection, go to the Query Builder
  2. Create a query for any table and include a field for a Lithostratigraphy or Chronostratigraphy tree rank (you can import this testquery.json)
  3. Run the query and see error.

Expected behavior Query results should be returned with no errors.

Screenshots

https://github.com/user-attachments/assets/55ec8a83-8fe1-4c2f-97de-75928454d1d8

https://kupaleobot20240606-edge.test.specifysystems.org/specify/query/43/

Crash Report

Specify 7 Crash Report - 2024-08-05T17_53_21.715Z.txt

Please, also fill out the following information manually:

realVinayak commented 3 months ago

https://github.com/specify/specify7/blob/32d330173e2863db7bafb711ab39dad2660b95c9/specifyweb/stored_queries/query_construct.py#L63

my oversight, table.name should be table.django_name