From 4e9593f19345a7feec452a33a636a0b9b7a16a6a Mon Sep 17 00:00:00 2001 From: Dr Kim Foale Date: Tue, 11 May 2021 18:41:40 +0100 Subject: [PATCH] Tweak notes display --- application/models.py | 12 ++++++------ features/admin_alarm.feature | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/application/models.py b/application/models.py index 6210f01..31e7c00 100644 --- a/application/models.py +++ b/application/models.py @@ -135,10 +135,10 @@ def handle_sos(self): time = timezone.localtime() subject = f"[IMOK] {self.name} sent an SOS" if self.notes == "": - notes = "There are no notes saved for this member" + notes = "No notes saved for this member" else: - notes = f"Notes: {self.notes}" - body = f"⚠️ {self.name} ({self.phone_number}) sent an SOS at {self.signing_center}.\n\n⏰ They raised it at {time.strftime('%H:%M')} on {time.strftime('%d/%m/%Y')}.\n\n{notes}." + notes = f"{self.notes}" + body = f"⚠️ {self.name} ({self.phone_number}) sent an SOS at {self.signing_center}.\n\n⏰ They raised it at {time.strftime('%H:%M')} on {time.strftime('%d/%m/%Y')}.\n\n📝 {notes}." notify_admins(subject, body) return _("Thank you for letting me know.\n\nI notified the admins at %(time)s.") % { "time": timezone.localtime().time().strftime('%X')} @@ -179,10 +179,10 @@ def timeout(self): subject = f"[IMOK] {self.member.name} is not safe" if self.member.notes == "": - notes = "There are no notes saved for this member" + notes = "No notes saved for this member" else: - notes = f"Notes: {self.member.notes}" - body = f"⚠️ {self.member.name} ({self.member.phone_number}) didn't sign out of {self.member.signing_center}.\n\n⏰ They signed in at {self.time_stamp.strftime('%H:%M on %d/%m/%Y')}.\n\n{notes}." + notes = f"{self.member.notes}" + body = f"⚠️ {self.member.name} ({self.member.phone_number}) didn't sign out of {self.member.signing_center}.\n\n⏰ They signed in at {self.time_stamp.strftime('%H:%M on %d/%m/%Y')}.\n\n📝 {notes}." print(body) notify_admins(subject, body) self.member.send_message(_("You didn't check out of %(location)s.\n\nI notified the admins at %(time)s.") % {"location": self.member.signing_center,"time": timezone.localtime().time().strftime('%X')}) diff --git a/features/admin_alarm.feature b/features/admin_alarm.feature index 98d182c..1583f63 100644 --- a/features/admin_alarm.feature +++ b/features/admin_alarm.feature @@ -20,8 +20,8 @@ Feature: An admin telegram group gets updated when there is an alert And the admins receive a message containing Examples: | notes | output | - | None | There are no notes saved for this member | - | My emergency contact is Mum Member on +447740000000 | My emergency contact is Mum Member on +447740000000 | + | None | 📝 No notes saved for this member | + | My emergency contact is Mum Member on +447740000000 | 📝 My emergency contact is Mum Member on +447740000000 | @@ -39,5 +39,5 @@ Feature: An admin telegram group gets updated when there is an alert And the admins receive a message containing Examples: | notes | output | - | None | There are no notes saved for this member | - | My emergency contact is Mum Member on +447740000000 | My emergency contact is Mum Member on +447740000000 | + | None | 📝 No notes saved for this member | + | My emergency contact is Mum Member on +447740000000 | 📝 My emergency contact is Mum Member on +447740000000 |