Skip to content

Commit 941b949

Browse files
committed
update: rename endpoll to end_poll
1 parent 79a7d5d commit 941b949

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

polls/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
path('add/', views.polls_add, name='add'),
1010
path('edit/<int:poll_id>/', views.polls_edit, name='edit'),
1111
path('delete/<int:poll_id>/', views.polls_delete, name='delete_poll'),
12-
path('end/<int:poll_id>/', views.endpoll, name='end_poll'),
12+
path('end/<int:poll_id>/', views.end_poll, name='end_poll'),
1313
path('edit/<int:poll_id>/choice/add/', views.add_choice, name='add_choice'),
1414
path('edit/choice/<int:choice_id>/', views.choice_edit, name='choice_edit'),
1515
path('delete/choice/<int:choice_id>/',

polls/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ def polls_add(request):
6363
poll = form.save(commit=False)
6464
poll.owner = request.user
6565
poll.save()
66-
new_choice1 = Choice(
66+
Choice(
6767
poll=poll, choice_text=form.cleaned_data['choice1']).save()
68-
new_choice2 = Choice(
68+
Choice(
6969
poll=poll, choice_text=form.cleaned_data['choice2']).save()
7070

7171
messages.success(
@@ -210,7 +210,7 @@ def poll_vote(request, poll_id):
210210

211211

212212
@login_required
213-
def endpoll(request, poll_id):
213+
def end_poll(request, poll_id):
214214
poll = get_object_or_404(Poll, pk=poll_id)
215215
if request.user != poll.owner:
216216
return redirect('home')

0 commit comments

Comments
 (0)