Jhelbert/enrollment mode change events

To be clear here, @jhelbert ,:

> +    When I register to audit the course "6.002x"
> +	And a "edx.course.enrollment.activated" server event is emitted
> +	And 1 "edx.course.enrollment.mode_changed" server events are emitted

If you first register as an "honor" student instead of an "audit"
student, NO mode_changed event is emitted, right, as the default mode
value is "honor"?

Upgrading from honor/audit to verified would emit two events in any
case: a mode_changed event and an upgrade event?

Thanks



On Mon, Jul 7, 2014 at 10:44 AM, brianhw <notifications@github.com> wrote:

> In common/djangoapps/student/models.py:
>
> > @@ -714,6 +715,8 @@ def update_enrollment(self, mode=None, is_active=None):
> >                            u"offering:{}".format(self.course_id.offering),
> >                            u"mode:{}".format(self.mode)]
> >                  )
> > +        if mode_changed:
> > +            self.emit_event(EVENT_NAME_ENROLLMENT_MODE_CHANGED)
>
> At the risk of opening a can of worms, was there discussion about writing
> out the original mode value before the change was made? It seems to me that
> such information would be a useful sanity check, even if it's not
> absolutely required. It would involve setting orig_mode before self.mode =
> mode, and passing an optional dict to self.emit_event which gets added to
> data.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/edx/edx-platform/pull/4285/files#r14599681>.
>