learning-unlimited/ESP-Website — pull request #1475 by randomguy64 (2014-11-28 00:51:08+00:00)
Title: Added is_active condition to Students and Teachers stats on the dashboard

Addresses a problem where the dashboard and arbitrary user lists counts didn't sync up, since the latter implicitly only searches for active users. (Presumably the discrepancy is if someone registers or makes a class and then requests an account deactivation; the class or registration doesn't go away. I have not addressed this, however, since that's not the issue I'm dealing with.)

The change I made makes the assumption that in the Students and Teacher stats are all of the form "Number of students who..." or "Number of teachers who..."; in particular, the dict returned by prog.students() and prog.teachers() (as processed by JSONDataModule.stats()) should exclusively contain QuerySets from the ESPUser model, or else bad things may happen. If this is an issue, I can rewrite the code to check if this is true or not.