Skip to content

Commit

Permalink
Do not send txt messages to duplicate numbers or overwrite message wi…
Browse files Browse the repository at this point in the history
…th python object
  • Loading branch information
AJamesPhillips committed Feb 20, 2014
1 parent 956c1f4 commit aaf11b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/cabotapp/alert.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ def send_sms_alert(service, users, duty_officers):
'host': settings.WWW_HTTP_HOST,
})
message = Template(sms_template).render(c)
mobiles = list(set(mobiles))
for mobile in mobiles:
try:
message = client.sms.messages.create(
client.sms.messages.create(
to=mobile,
from_=settings.TWILIO_OUTGOING_NUMBER,
body=message,
Expand Down

0 comments on commit aaf11b9

Please sign in to comment.