-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
alaa
committed
Apr 6, 2023
1 parent
d3ce855
commit ef71c3a
Showing
4 changed files
with
10 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,11 @@ | |
from .models import Poll, Choice, Vote | ||
from .serializers import PollSerializer, VoteSerializer | ||
from django.core.mail import send_mail | ||
from django.utils import timezone | ||
import environ | ||
|
||
|
||
env = environ.Env() | ||
environ.Env.read_env() | ||
|
||
|
||
class PollViewSet(viewsets.ModelViewSet): | ||
|
@@ -39,7 +43,7 @@ def create(self, request): | |
send_mail( | ||
'Your One-Time Password for Voting', | ||
f'Your OTP is {vote.otp}. It will expire in 10 minutes.', | ||
'[email protected]', | ||
env('EMAIL_ADDRESS'), | ||
[email], | ||
fail_silently=False, | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters