diff --git a/smash/web/models/study_visit_list.py b/smash/web/models/study_visit_list.py index 3c49f094601deca34dc2d7199fdc5c26d4c96f1e..1d67e3253dfaa20fc127c21be26d9e0527556c0b 100644 --- a/smash/web/models/study_visit_list.py +++ b/smash/web/models/study_visit_list.py @@ -13,11 +13,11 @@ VISIT_LIST_APPROACHING_FOR_MAIL_CONTACT = "APPROACHING_FOR_MAIL_CONTACT" VISIT_LIST_CHOICES = { VISIT_LIST_GENERIC: 'Generic visit list', - VISIT_LIST_EXCEEDED_TIME: 'exceeded visit time', - VISIT_LIST_UNFINISHED: 'unfinished visits', - VISIT_LIST_MISSING_APPOINTMENTS: 'visits with missing appointments', - VISIT_LIST_APPROACHING_WITHOUT_APPOINTMENTS: 'approaching visits', - VISIT_LIST_APPROACHING_FOR_MAIL_CONTACT: 'post mail for approaching visits', + VISIT_LIST_EXCEEDED_TIME: 'Exceeded visit time', + VISIT_LIST_UNFINISHED: 'Unfinished visits', + VISIT_LIST_MISSING_APPOINTMENTS: 'Visits with missing appointments', + VISIT_LIST_APPROACHING_WITHOUT_APPOINTMENTS: 'Approaching visits', + VISIT_LIST_APPROACHING_FOR_MAIL_CONTACT: 'Post mail for approaching visits', } diff --git a/smash/web/views/notifications.py b/smash/web/views/notifications.py index b54ca23303a37c3ed4aba60cf4c275119a577845..edee35b6d89590df8eb4fc67d16d236946c42f6a 100644 --- a/smash/web/views/notifications.py +++ b/smash/web/views/notifications.py @@ -247,7 +247,7 @@ def get_exceeded_visits(user): Q(visit_number__gt=1) | Q(appointment__status=Appointment.APPOINTMENT_STATUS_FINISHED)).filter( # visits that have scheduled appointments should be excluded ~Q(appointment__status=Appointment.APPOINTMENT_STATUS_SCHEDULED)).order_by( - 'datetime_begin') + 'datetime_begin').distinct() def get_missing_redcap_subjects(user, include_ignored=True):