Commit cff93438 by Jonathan Piacenti

Change issuing_component for included badge events.

parent a04a635e
...@@ -77,7 +77,7 @@ class UserBadgeAssertions(generics.ListAPIView): ...@@ -77,7 +77,7 @@ class UserBadgeAssertions(generics.ListAPIView):
{ {
"badge_class": { "badge_class": {
"slug": "special_award", "slug": "special_award",
"issuing_component": "edx__course", "issuing_component": "openedx__course",
"display_name": "Very Special Award", "display_name": "Very Special Award",
"course_id": "course-v1:edX+DemoX+Demo_Course", "course_id": "course-v1:edX+DemoX+Demo_Course",
"description": "Awarded for people who did something incredibly special", "description": "Awarded for people who did something incredibly special",
......
...@@ -20,7 +20,7 @@ def award_badge(config, count, user): ...@@ -20,7 +20,7 @@ def award_badge(config, count, user):
if not slug: if not slug:
return return
badge_class = BadgeClass.get_badge_class( badge_class = BadgeClass.get_badge_class(
slug=slug, issuing_component='edx__course', create=False, slug=slug, issuing_component='openedx__course', create=False,
) )
if not badge_class: if not badge_class:
return return
...@@ -72,7 +72,7 @@ def course_group_check(user, course_key): ...@@ -72,7 +72,7 @@ def course_group_check(user, course_key):
for slug in awards: for slug in awards:
badge_class = BadgeClass.get_badge_class( badge_class = BadgeClass.get_badge_class(
slug=slug, issuing_component='edx__course', create=False, slug=slug, issuing_component='openedx__course', create=False,
) )
if badge_class and not badge_class.get_for_user(user): if badge_class and not badge_class.get_for_user(user):
badge_class.award(user) badge_class.award(user)
...@@ -34,13 +34,13 @@ class CourseEnrollmentBadgeTest(ModuleStoreTestCase): ...@@ -34,13 +34,13 @@ class CourseEnrollmentBadgeTest(ModuleStoreTestCase):
super(CourseEnrollmentBadgeTest, self).setUp() super(CourseEnrollmentBadgeTest, self).setUp()
self.badge_classes = [ self.badge_classes = [
RandomBadgeClassFactory( RandomBadgeClassFactory(
issuing_component='edx__course' issuing_component='openedx__course'
), ),
RandomBadgeClassFactory( RandomBadgeClassFactory(
issuing_component='edx__course' issuing_component='openedx__course'
), ),
RandomBadgeClassFactory( RandomBadgeClassFactory(
issuing_component='edx__course' issuing_component='openedx__course'
), ),
] ]
nums = ['3', '5', '8'] nums = ['3', '5', '8']
...@@ -102,13 +102,13 @@ class CourseCompletionBadgeTest(ModuleStoreTestCase): ...@@ -102,13 +102,13 @@ class CourseCompletionBadgeTest(ModuleStoreTestCase):
super(CourseCompletionBadgeTest, self).setUp() super(CourseCompletionBadgeTest, self).setUp()
self.badge_classes = [ self.badge_classes = [
RandomBadgeClassFactory( RandomBadgeClassFactory(
issuing_component='edx__course' issuing_component='openedx__course'
), ),
RandomBadgeClassFactory( RandomBadgeClassFactory(
issuing_component='edx__course' issuing_component='openedx__course'
), ),
RandomBadgeClassFactory( RandomBadgeClassFactory(
issuing_component='edx__course' issuing_component='openedx__course'
), ),
] ]
nums = ['2', '6', '9'] nums = ['2', '6', '9']
...@@ -179,13 +179,13 @@ class CourseGroupBadgeTest(ModuleStoreTestCase): ...@@ -179,13 +179,13 @@ class CourseGroupBadgeTest(ModuleStoreTestCase):
super(CourseGroupBadgeTest, self).setUp() super(CourseGroupBadgeTest, self).setUp()
self.badge_classes = [ self.badge_classes = [
RandomBadgeClassFactory( RandomBadgeClassFactory(
issuing_component='edx__course' issuing_component='openedx__course'
), ),
RandomBadgeClassFactory( RandomBadgeClassFactory(
issuing_component='edx__course' issuing_component='openedx__course'
), ),
RandomBadgeClassFactory( RandomBadgeClassFactory(
issuing_component='edx__course' issuing_component='openedx__course'
), ),
] ]
self.courses = [] self.courses = []
......
...@@ -20,9 +20,9 @@ class Migration(migrations.Migration): ...@@ -20,9 +20,9 @@ class Migration(migrations.Migration):
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')), ('change_date', models.DateTimeField(auto_now_add=True, verbose_name='Change date')),
('enabled', models.BooleanField(default=False, verbose_name='Enabled')), ('enabled', models.BooleanField(default=False, verbose_name='Enabled')),
('courses_completed', models.TextField(default=b'', help_text="On each line, put the number of completed courses to award a badge for, a comma, and the slug of a badge class you have created with the issuing component 'edx__course'. For example: 3,enrolled_3_courses", blank=True)), ('courses_completed', models.TextField(default=b'', help_text="On each line, put the number of completed courses to award a badge for, a comma, and the slug of a badge class you have created that has the issuing component 'openedx__course'. For example: 3,enrolled_3_courses", blank=True)),
('courses_enrolled', models.TextField(default=b'', help_text="On each line, put the number of enrolled courses to award a badge for, a comma, and the slug of a badge class you have created with the issuing component 'edx__course'. For example: 3,enrolled_3_courses", blank=True)), ('courses_enrolled', models.TextField(default=b'', help_text="On each line, put the number of enrolled courses to award a badge for, a comma, and the slug of a badge class you have created that has the issuing component 'openedx__course'. For example: 3,enrolled_3_courses", blank=True)),
('course_groups', models.TextField(default=b'', help_text="Each line is a comma-separated list. The first item in each line is the slug of a badge class to award, with an issuing component of 'edx__course'. The remaining items in each line are the course keys the user will need to complete to be awarded the badge. For example: slug_for_compsci_courses_group_badge,course-v1:CompSci+Course+First,course-v1:CompsSci+Course+Second", blank=True)), ('course_groups', models.TextField(default=b'', help_text="Each line is a comma-separated list. The first item in each line is the slug of a badge class you have created that has an issuing component of 'openedx__course'. The remaining items in each line are the course keys the learner needs to complete to be awarded the badge. For example: slug_for_compsci_courses_group_badge,course-v1:CompSci+Course+First,course-v1:CompsSci+Course+Second", blank=True)),
('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')), ('changed_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, editable=False, to=settings.AUTH_USER_MODEL, null=True, verbose_name='Changed by')),
], ],
), ),
......
...@@ -220,7 +220,7 @@ class CourseEventBadgesConfiguration(ConfigurationModel): ...@@ -220,7 +220,7 @@ class CourseEventBadgesConfiguration(ConfigurationModel):
blank=True, default='', blank=True, default='',
help_text=_( help_text=_(
u"On each line, put the number of completed courses to award a badge for, a comma, and the slug of a " u"On each line, put the number of completed courses to award a badge for, a comma, and the slug of a "
u"badge class you have created with the issuing component 'edx__course'. " u"badge class you have created that has the issuing component 'openedx__course'. "
u"For example: 3,enrolled_3_courses" u"For example: 3,enrolled_3_courses"
) )
) )
...@@ -228,16 +228,16 @@ class CourseEventBadgesConfiguration(ConfigurationModel): ...@@ -228,16 +228,16 @@ class CourseEventBadgesConfiguration(ConfigurationModel):
blank=True, default='', blank=True, default='',
help_text=_( help_text=_(
u"On each line, put the number of enrolled courses to award a badge for, a comma, and the slug of a " u"On each line, put the number of enrolled courses to award a badge for, a comma, and the slug of a "
u"badge class you have created with the issuing component 'edx__course'. " u"badge class you have created that has the issuing component 'openedx__course'. "
u"For example: 3,enrolled_3_courses" u"For example: 3,enrolled_3_courses"
) )
) )
course_groups = models.TextField( course_groups = models.TextField(
blank=True, default='', blank=True, default='',
help_text=_( help_text=_(
u"Each line is a comma-separated list. The first item in each line is the slug of a badge class to award, " u"Each line is a comma-separated list. The first item in each line is the slug of a badge class you "
u"with an issuing component of 'edx__course'. The remaining items in each line are the course keys the " u"have created that has an issuing component of 'openedx__course'. The remaining items in each line are "
u"user will need to complete to be awarded the badge. For example: " u"the course keys the learner needs to complete to be awarded the badge. For example: "
u"slug_for_compsci_courses_group_badge,course-v1:CompSci+Course+First,course-v1:CompsSci+Course+Second" u"slug_for_compsci_courses_group_badge,course-v1:CompSci+Course+First,course-v1:CompsSci+Course+Second"
) )
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment