state = CompetitionState.get_state()
if state == CompetitionState.DURING:
state = 'single'
+ if request.META['REMOTE_ADDR'] in getattr(settings, 'WTEM_CONTEST_IP_ALLOW', []):
+ state = 'single'
return globals()['form_' + state](request, submission_id, key)
except ValueError as e:
if e.message == 'wrong exercise id':
messages.error(request, u'Próba wysłania odpowiedzi ponownie lub poza kolejnością')
+ elif e.message == 'no answer':
+ messages.error(request, u'Wybierz przynajmniej jedną odpowiedź')
return HttpResponseRedirect(reverse('wtem_form', kwargs={'submission_id': submission_id, 'key': key}))
else:
- raise Exception
+ raise Exception(u'Błędna wartość w formularzu')
@cache_until_start
if not was_confirmed:
conf.confirmed = True
conf.save()
- return render(request, 'wtem/teacher_confirmed.html', {'confirmation': conf, 'was_confirmed': was_confirmed})
+ from contact.forms import contact_forms
+ form_class = contact_forms['olimpiada']
+ if not form_class.is_disabled():
+ pass
+ return render(request, 'wtem/teacher_confirmed.html', {
+ 'confirmation': conf,
+ 'was_confirmed': was_confirmed,
+ })