@receiver(post_save, sender=CourseEnrollment)
def assign_default_role_on_enrollment(sender, instance, **kwargs):
 assign_default_role(instance.course_id, instance.user)

@ receiver ( post_save , sender = CourseEnrollment ) def assign_default_role_on_enrollment ( sender , instance , ** kwargs ) : assign_default_role ( instance . course_id , instance . user )
assign forum default role student .