Merge branch 'feature/LIL-711' into 'master'

Feature/lil 711

See merge request lilcity/backend!222
remotes/origin/feature/LIL-711
cfwme 7 years ago
commit 6cc64636be
  1. 3
      apps/notification/tasks.py

@ -84,6 +84,8 @@ def sendgrid_update_recipients():
for user in users:
last_course_purchase = course_payments.get(user.id) and course_payments.get(user.id).strftime(date_format)
last_school_purchase = school_payments.get(user.id) and school_payments.get(user.id).strftime(date_format)
courses_purchased = CoursePayment.objects.filter(user=user,
status__in=CoursePayment.PW_PAID_STATUSES).values_list('course_id', flat=True)
data.append({
'first_name': user.first_name,
'last_name': user.last_name,
@ -94,6 +96,7 @@ def sendgrid_update_recipients():
# 'gender': {User.NOT_DEFINED: '', User.MALE: 'Мужчина', User.FEMALE: 'Женщина'}[user.gender] if user.gender else '',
'birthday': user.birthday and user.birthday.strftime(date_format),
'date_joined': user.date_joined.strftime(date_format),
'courses_purchased': ','.join(map(str, courses_purchased)) + ',' if courses_purchased else '',
})
sg = get_sendgrid_client()

Loading…
Cancel
Save