Skip to content

Commit e4c56aa

Browse files
authored
Update views.py
1 parent 6baf0c2 commit e4c56aa

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

polls/views.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,17 +211,15 @@ def poll_vote(request, poll_id):
211211
if choice_id:
212212
choice = Choice.objects.get(id=choice_id)
213213
vote = Vote(user=request.user, poll=poll, choice=choice)
214-
vote.save()
215-
print(vote)
214+
vote.save()
216215

217216
# get poll creator email
218217
poll_creator_email = poll.owner.email
219218
# Construct the email
220219
subject = f'New vote for your poll: {poll.text}'
221220
message = f'A new vote has been cast for your poll "{poll.text}".'
222221
# Send the email
223-
send_mail(subject, message, settings.EMAIL_HOST_USER, [poll_creator_email])
224-
print("Mail sent successfully to" + poll.owner.email)
222+
send_mail(subject, message, settings.EMAIL_HOST_USER, [poll_creator_email])
225223

226224
return render(request, 'polls/poll_result.html', {'poll': poll})
227225
else:

0 commit comments

Comments
 (0)