Skip to content

Commit

Permalink
Tweak notes display
Browse files Browse the repository at this point in the history
  • Loading branch information
kimadactyl authored and wheresalice committed May 11, 2021
1 parent 963a13c commit 4e9593f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions application/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')}
Expand Down Expand Up @@ -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')})
Expand Down
8 changes: 4 additions & 4 deletions features/admin_alarm.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Feature: An admin telegram group gets updated when there is an alert
And the admins receive a message containing <output>
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 |



Expand All @@ -39,5 +39,5 @@ Feature: An admin telegram group gets updated when there is an alert
And the admins receive a message containing <output>
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 |

0 comments on commit 4e9593f

Please sign in to comment.