Log door card access time in Calgary timezone

This commit is contained in:
Tanner Collin 2021-08-12 00:45:49 +00:00
parent e9727fc5d2
commit 9afa2fce32
2 changed files with 5 additions and 1 deletions

View File

@ -26,6 +26,9 @@ STATIC_FOLDER = 'data/static/'
def today_alberta_tz(): def today_alberta_tz():
return datetime.now(pytz.timezone('America/Edmonton')).date() return datetime.now(pytz.timezone('America/Edmonton')).date()
def now_alberta_tz():
return datetime.now(pytz.timezone('America/Edmonton'))
def alert_tanner(message): def alert_tanner(message):
try: try:
logger.info('Alerting Tanner: ' + message) logger.info('Alerting Tanner: ' + message)

View File

@ -439,7 +439,8 @@ class DoorViewSet(viewsets.ViewSet, List):
member = card.user.member member = card.user.member
else: else:
member = models.Member.objects.get(id=card.member_id) member = models.Member.objects.get(id=card.member_id)
logger.info('Name: {} {} ({})'.format(member.first_name, member.last_name, member.id)) t = utils.now_alberta_tz().strftime('%Y-%m-%d %H:%M:%S, %a %I:%M %p')
logger.info('Time: {} - Name: {} {} ({})'.format(t, member.first_name, member.last_name, member.id))
utils_stats.calc_card_scans() utils_stats.calc_card_scans()