Stanford-Online/edx-platform — pull request #111 by sefk (2014-08-20 23:53:41+00:00)
Title: direct access: exclude non-registered from enrollments

Direct access introduces a bunch of fake course enrollments. We
don't want to include those in the counts of students enrolled in
the course, nor in the list of students dumped out in the course
roster.

Note the use of the "extra" to add a join and where clause to the
query. Becuase there is no foreign key from User to UserProfile,
just the other way around, we can't use the ORM to generate these
joins for us. This is what you'd wish would work, but doesn't.

exclude(user__userprofile__nonregistered=1)

Hence we're back to this annoying "extra" business.

@jbau review pls.