I’m sorry, I can’t test it with different databases due to compagnie restrictions. It has to work with the mssql db 
It does. Do you have an idea why this could be?
I understand that you need to have something working with mssql. However, I’m suggesting this as a diagnostic step to isolate the cause of the problem.
If it works for you on a different database (as it does for me), then the problem is likely to be associated with the database engine and not Django or your code. The problem report should go to whoever maintains that database engine.
I know
and thank you very much for your help!
It’s just that I can’t test it on a different engine due to the company. I will redirect the problem/report to the maintainer of the db.
I fixed it!
Just had to put it in an {% if institution.parent_institution %}
The error came because the next institution didn’t have a parent and then everything crushed.
Thanks for all the help and time! 