burke-software / django-report-utils

Common functions used for reporting needs. Used by django-report-builder and django-report-scaffold.
Other
10 stars 27 forks source link

get_relation_fields_from_model crashes django admin in certain cases. #20

Open lbrindze opened 9 years ago

lbrindze commented 9 years ago

In our application use case of report builder (running django 1.8, with report_builder 3.2) anytime a call runs through get_relation_fields_from_model and a related field is found (adding it to relation_fields, line 43) it crashes the admin because line 42 changes state on the actual ManyToOneRel object.

I have a fix for this, it simply involves copying the original object (found in the field[0]) before renaming it. Reports still run, and my admin doesn't crash.

Let me know if this is a verified issue, and if I should submit the PR.

smwise commented 8 years ago

Did anyone ever take a look at this? The same issue is open for django-report-builder. I was going to take the same approach, copy (so as to not change the rest of the logic at all), but don't want to duplicate effort if someone else already has a PR ready.

bufke commented 8 years ago

@smwise I'm not aware of anyone working on this. It would be good to include a unit test in any pull request to clearly demonstrate the problem since it's a bit confusing.

bufke commented 8 years ago

Also if you wanted to help out I think it would make sense to just move this functionality to report builder itself. I don't use this project anymore - it was originally it's own git repo because it was used by some other tools I made - but those tools are no longer maintained and never got popular as report builder has.