Ok, I fixed this but mainly by changing CourseKeyField.get_prep_value to
return None. My hypothesis is that a lower layer converts None to empty
string if the column is CharField. The xmodule lib tests all run
successfully. I'm running the lms tests now.


On Thu, May 1, 2014 at 4:37 PM, Calen Pennington
<notifications@github.com>wrote:

> In common/djangoapps/student/roles.py:
>
> >
> >      def remove_users(self, *users):
> >          """
> >          Remove the supplied django users from this role.
> >          """
> > -        groups = Group.objects.filter(name__in=self._group_names)
> > -        for group in groups:
> > -            group.user_set.remove(*users)
> > -        # remove cache
> > +        if self.course_key:
> > +            entries = CourseAccessRole.objects.filter(
> > +                user__in=users, role=self._role_name, org=self.org, course_id=self.course_key
> > +            )
> > +        else:
> > +            entries = CourseAccessRole.objects.filter(
> > +                user__in=users, role=self._role_name, org=self.org
>
> 'we got errors' is sufficiently vague to make me want to dig into this
> more. Also, not a fan of filtering in Python. Let's figure out what we need
> to do in the django field to make this use case work (especially since
> we're allowing the column to be nullable).
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/edx/edx-platform/pull/3549/files#r12206078>
> .
>