class LiveConferenceNotify(APIView):
+
def post(self, request):
"""
notify users a new live conference is starting
students = Student.objects.filter(period=conference.period, platform_only=True)
text = f"""Une conférence live "{conference.course.title}" commence"""
url = reverse('teleforma-conference-detail', kwargs={'period_id': conference.period.id, 'pk': conference.id})
+
+ # notify students
for student in students:
try:
if student.user:
except Exception as e:
logger.warning("Student NOT notified: " + str(student.id))
logger.warning(e)
- return Response({'status': 'ok'})
-
-
+ continue
+ # notify staff
+ for user in User.objects.filter(is_staff=True):
+ notify(student.user, text, url)
+
+ return Response({'status': 'ok'})
# class ConferenceRecordView(FormView):