Browse Source

prednasky | oprava ukladani

remotes/origin/posli-mail-autorovi-korektury
Bc. Petr Pecha 9 years ago
parent
commit
70d8a18748
  1. 5
      prednasky/views.py
  2. 4
      seminar/urls.py

5
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')

4
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'),

Loading…
Cancel
Save