|
@ -1,9 +1,9 @@ |
|
|
# coding:utf-8 |
|
|
# coding:utf-8 |
|
|
|
|
|
|
|
|
from django.shortcuts import get_object_or_404, render |
|
|
from django.shortcuts import get_object_or_404, render |
|
|
from django.http import HttpResponseRedirect |
|
|
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden |
|
|
from django.http import HttpResponse |
|
|
|
|
|
from django.core.urlresolvers import reverse |
|
|
from django.core.urlresolvers import reverse |
|
|
|
|
|
from django.core.exceptions import PermissionDenied |
|
|
from django.views import generic |
|
|
from django.views import generic |
|
|
from django.utils.translation import ugettext as _ |
|
|
from django.utils.translation import ugettext as _ |
|
|
from django.http import Http404 |
|
|
from django.http import Http404 |
|
@ -235,11 +235,14 @@ class ProblemView(generic.DetailView): |
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs): |
|
|
def get_context_data(self, **kwargs): |
|
|
context = super(ProblemView, self).get_context_data(**kwargs) |
|
|
context = super(ProblemView, self).get_context_data(**kwargs) |
|
|
|
|
|
if not context['problem'].verejne() and not self.request.user.is_staff: |
|
|
|
|
|
raise PermissionDenied() |
|
|
if context['problem'].typ == Problem.TYP_RES_CLANEK: |
|
|
if context['problem'].typ == Problem.TYP_RES_CLANEK: |
|
|
context['reseni'] = Reseni.objects.filter(problem=context['problem']).select_related('resitel').order_by('resitel__prijmeni') |
|
|
context['reseni'] = Reseni.objects.filter(problem=context['problem']).select_related('resitel').order_by('resitel__prijmeni') |
|
|
return context |
|
|
return context |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class RadekVysledkovky(object): |
|
|
class RadekVysledkovky(object): |
|
|
pass |
|
|
pass |
|
|
|
|
|
|
|
|