Skip to content

Commit

Permalink
Added time for registration
Browse files Browse the repository at this point in the history
  • Loading branch information
akkupy committed May 20, 2023
1 parent 4077b44 commit f23797c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Z-Vote/poll/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ def otp(request):


def register(request):
time = get_vote_auth()
format = "%d/%m/%Y at %H:%M:%S %Z%z"
if time[0].end<datetime.datetime.now(datetime.timezone.utc):
asia = time[0].end.astimezone(timezone('Asia/Kolkata'))
context = {
'fail' : "Cannot Register! Voting ended on "+asia.strftime(format),
}
return render(request,'poll/failure.html',context)
if request.method=='POST':
username = request.POST.get('username')
validVoter = models.VoterList.objects.filter(username=username).exists()
Expand Down

0 comments on commit f23797c

Please sign in to comment.