Skip to content

Commit

Permalink
style: [AXM-373] remove debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
NiedielnitsevIvan committed May 14, 2024
1 parent 36f5306 commit 05ca8d2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
29 changes: 15 additions & 14 deletions lms/djangoapps/instructor/enrollment.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,14 @@ def enroll_email(course_id, student_email, auto_enroll=False, email_students=Fal
"""
previous_state = EmailEnrollmentState(course_id, student_email)
enrollment_obj = None
email_params.update({
'app_label': 'instructor',
'push_notification_extra_context': {
'notification_type': 'enroll',
'course_id': str(course_id),
},
})
if email_params:
email_params.update({
'app_label': 'instructor',
'push_notification_extra_context': {
'notification_type': 'enroll',
'course_id': str(course_id),
},
})
if previous_state.user and previous_state.user.is_active:
# if the student is currently unenrolled, don't enroll them in their
# previous mode
Expand Down Expand Up @@ -201,13 +202,13 @@ def unenroll_email(course_id, student_email, email_students=False, email_params=
representing state before and after the action.
"""
previous_state = EmailEnrollmentState(course_id, student_email)
email_params.update({
'app_label': 'instructor',
'push_notification_extra_context': {
'notification_type': 'unenroll',
},
})
import pdb;pdb.set_trace()
if email_params:
email_params.update({
'app_label': 'instructor',
'push_notification_extra_context': {
'notification_type': 'unenroll',
},
})
if previous_state.enrollment:
CourseEnrollment.unenroll_by_email(student_email, course_id)
if email_students:
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/notifications/policies.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def check(self, message):
course_ids = message.context.get('course_ids', [])
app_label = message.context.get('app_label')

if not (app_label or message.context.get('push_notification_extra_context', False)):
if not (app_label or message.context.get('push_notification_extra_context', {})):
return PolicyResult(deny={ChannelType.PUSH})

course_keys = [CourseKey.from_string(course_id) for course_id in course_ids]
Expand Down

0 comments on commit 05ca8d2

Please sign in to comment.