Add member's name and date to Spaceporter host bot message

This commit is contained in:
Tanner Collin 2023-07-30 01:06:40 +00:00
parent 10de956256
commit f9df9cd4cd

View File

@ -1796,9 +1796,10 @@ class HostingViewSet(Base):
try: # TODO: remove try / except try: # TODO: remove try / except
# send a message to Spacebar # send a message to Spacebar
message = 'A member just offered to host for {} hours from now until {}!'.format( message = '{} just offered to host for {} hours from now until {}!'.format(
hosting_user.member.preferred_name,
hours, hours,
h.finished_at.astimezone(utils.TIMEZONE_CALGARY).strftime('%-I:%M %p'), h.finished_at.astimezone(utils.TIMEZONE_CALGARY).strftime('%-I:%M %p, %b %d'),
) )
if hosting_user.member.discourse_username: if hosting_user.member.discourse_username:
message += ' Tag @{} here to get their attention.'.format( message += ' Tag @{} here to get their attention.'.format(