Skip to content

Commit

Permalink
added logic that check a request method
Browse files Browse the repository at this point in the history
  • Loading branch information
punkyoon committed Mar 18, 2017
1 parent aa355f9 commit c2e0c78
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions coding_night_live/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@ def PageNotFound(request):
return render(request, '404.html', status=404)

def withdraw(request):
User.objects.get(email=request.user.email).delete
return HttpResponseRedirect('/')
if request.method == 'POST':
User.objects.get(email=request.user.email).delete
else:
print('Request method is not a GET.')
return HttpResponseRedirect('/')

0 comments on commit c2e0c78

Please sign in to comment.