From 70d8a187482d83c26f006f91f4fc270fc7b61e58 Mon Sep 17 00:00:00 2001 From: "Bc. Petr Pecha" Date: Mon, 18 Apr 2016 01:27:05 +0200 Subject: [PATCH] prednasky | oprava ukladani --- prednasky/views.py | 5 +++-- seminar/urls.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/prednasky/views.py b/prednasky/views.py index 4d93397d..6f0fed53 100644 --- a/prednasky/views.py +++ b/prednasky/views.py @@ -14,7 +14,8 @@ def newPrednaska(request): for i in request.POST: if i[0] == 'q': hlasovani = Hlasovani() - hlasovani.prednaska = Prednaska.objects.filter(pk = i[1])[0] + print(i[1]) + hlasovani.prednaska = Prednaska.objects.filter(pk = int(i[1]))[0] hlasovani.body = int(request.POST[i]) hlasovani.ucastnik = jmeno hlasovani.save() @@ -30,7 +31,7 @@ def newPrednaska(request): 'prednasky' : prednasky, }) -def Prednaska(request): +def Prednaska_hotovo(request): return render(request, 'prednasky/hotovo.html') diff --git a/seminar/urls.py b/seminar/urls.py index ef28ae9d..545d0d02 100644 --- a/seminar/urls.py +++ b/seminar/urls.py @@ -3,14 +3,14 @@ from django.conf.urls import patterns, url from django.contrib.auth.decorators import user_passes_test from . import views, export from utils import staff_member_required -from prednasky.views import newPrednaska, Prednaska +from prednasky.views import newPrednaska, Prednaska_hotovo staff_member_required = user_passes_test(lambda u: u.is_staff) urlpatterns = [ # prednasky url(r'^prednasky/$', newPrednaska), - url(r'^prednasky/hotovo$', Prednaska), + url(r'^prednasky/hotovo$', Prednaska_hotovo), url(r'^co-je-MaM/organizatori/$', views.CojemamOrganizatoriView.as_view(), name='organizatori'), url(r'^co-je-MaM/organizatori/organizovali/$', views.CojemamOrganizatoriStariView.as_view(), name='stari_organizatori'),