Absolutely no reason whatsoever to filter based on browser.

I am guessing this is old cut-and-paste code from a project of yours called ecalc? Because the templates in question inherit from ecalc rather than django_cas.