From 93877890fc4aba2e9a4901ab0178f29c1d8276f0 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Mon, 6 Nov 2017 13:56:27 -0500 Subject: [PATCH] EDUCATOR-1635 Log Role Creation --- common/djangoapps/django_comment_common/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/djangoapps/django_comment_common/models.py b/common/djangoapps/django_comment_common/models.py index e47feb6e2a..6f753d1465 100644 --- a/common/djangoapps/django_comment_common/models.py +++ b/common/djangoapps/django_comment_common/models.py @@ -54,7 +54,9 @@ def assign_role(course_id, user, rolename): """ Assign forum role `rolename` to user """ - role, __ = Role.objects.get_or_create(course_id=course_id, name=rolename) + role, created = Role.objects.get_or_create(course_id=course_id, name=rolename) + if created: + logging.info("EDUCATOR-1635: Created role {} for course {}".format(role, course_id)) user.roles.add(role)