Skip to content

Commit

Permalink
Merge 53704d4 into 357c735
Browse files Browse the repository at this point in the history
  • Loading branch information
xzzy committed Sep 16, 2019
2 parents 357c735 + 53704d4 commit f8ae2c0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 13 additions & 1 deletion mooring/emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
from confy import env
from django.template import Context
from ledger.accounts.models import Document
from django.contrib.auth.models import Group
from ledger.accounts.models import EmailUser

import datetime
import hashlib

Expand Down Expand Up @@ -392,6 +395,10 @@ def send_refund_failure_email_admissions(booking, context_processor):
to = settings.NON_PROD_EMAIL
sendHtmlEmail([to],subject,context,template,cc,bcc,from_email,template_group,attachments=None)
else:
pa = Group.objects.get(name='Payments Officers')
ma = Group.objects.get(name="Mooring Admin")
user_list = EmailUser.objects.filter(groups__in=[ma,]).distinct()

for u in user_list:
to = u.email
sendHtmlEmail([to],subject,context,template,cc,bcc,from_email,template_group,attachments=None)
Expand Down Expand Up @@ -434,6 +441,11 @@ def send_refund_failure_email(booking, context_processor):
to = settings.NON_PROD_EMAIL
sendHtmlEmail([to],subject,context,template,cc,bcc,from_email,template_group,attachments=None)
else:

pa = Group.objects.get(name='Payments Officers')
ma = Group.objects.get(name="Mooring Admin")
user_list = EmailUser.objects.filter(groups__in=[ma,]).distinct()

for u in user_list:
to = u.email
sendHtmlEmail([to],subject,context,template,cc,bcc,from_email,template_group,attachments=None)
Expand Down Expand Up @@ -488,7 +500,7 @@ def send_refund_failure_email_old(booking):

pa = Group.objects.get(name='Payments Officers')
ma = Group.objects.get(name="Mooring Admin")
user_list = EmailUser.objects.filter(groups__in=[pa,ma]).distinct()
user_list = EmailUser.objects.filter(groups__in=[ma,]).distinct()

### REMOVE ###
for u in user_list:
Expand Down
4 changes: 2 additions & 2 deletions mooring/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1272,11 +1272,11 @@ def post(self, request, *args, **kwargs):
to_dt = local_dt.replace(microsecond=booking.departure.microsecond)
to_date_converted = to_dt.date()
# generate invoice
reservation = u"Reservation for {} from {} to {} at {}".format(
reservation = u"Reservation for {} from {} to {} ".format(
u'{} {}'.format(booking.customer.first_name, booking.customer.last_name),
from_date_converted,
to_date_converted,
booking.mooringarea.name
#booking.mooringarea.name
)

logger.info('{} built booking {} and handing over to payment gateway'.format('User {} with id {}'.format(booking.customer.get_full_name(),booking.customer.id) if booking.customer else 'An anonymous user',booking.id))
Expand Down

0 comments on commit f8ae2c0

Please sign in to comment.