From: Guillaume Pellerin Date: Wed, 29 Jun 2022 21:45:58 +0000 (+0200) Subject: add soft exception X-Git-Tag: 2.7.1~21 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=46550ca0627c1d758923439479687c34c9c5aeb5;p=teleforma.git add soft exception --- diff --git a/teleforma/management/commands/teleforma-publish-notify-conferences.py b/teleforma/management/commands/teleforma-publish-notify-conferences.py index 3357f77a..464ef8a6 100644 --- a/teleforma/management/commands/teleforma-publish-notify-conferences.py +++ b/teleforma/management/commands/teleforma-publish-notify-conferences.py @@ -66,13 +66,17 @@ class Command(BaseCommand): students = Student.objects.filter(period=conference.period) for student in students: - if student.user: - courses = get_courses(student.user, period=conference.period) - for course in courses: - if conference.course == course['course'] and \ - conference.course_type in course['types']: - notify(student.user, message, url) - logger.logger.info("Student notified: " + student.user.username) + try: + if student.user: + courses = get_courses(student.user, period=conference.period) + for course in courses: + if conference.course == course['course'] and \ + conference.course_type in course['types']: + notify(student.user, message, url) + logger.logger.info("Student notified: " + student.user.username) + except: + logger.logger.info("Student NOT notified: " + student.user.username) + continue conference.notified = True conference.save()