Skip to content

Commit

Permalink
(no-ticket) Fix missing REQUEST field
Browse files Browse the repository at this point in the history
It was removed in new django release.

Change-Id: I62878d2d7226fff9168b28e66e781e2b699f30c4
  • Loading branch information
teqwve committed Oct 19, 2017
1 parent 9940524 commit 3e17e46
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
5 changes: 2 additions & 3 deletions oioioi/clock/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@ def get_times_status(request, response):


def admin_time(request, next_page=None):
if 'next' in request.REQUEST:
next_page = request.REQUEST['next']

if request.method == 'POST':
if 'next' in request.POST:
next_page = request.POST['next']
if 'reset-button' in request.POST:
if 'admin_time' in request.session:
del request.session['admin_time']
Expand Down
14 changes: 8 additions & 6 deletions oioioi/oi/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.template.response import TemplateResponse, SimpleTemplateResponse
from django.template.loader import render_to_string
from django.template import RequestContext
from django.views.decorators.http import require_POST
from django.views.decorators.http import require_POST, require_GET

from oioioi.base.permissions import not_anonymous, enforce_condition
from oioioi.contests.utils import is_contest_admin
Expand All @@ -31,21 +31,23 @@ def registration_notice_fragment(request):
return None


@require_GET
@enforce_condition(not_anonymous)
def cities_view(request):
if 'province' not in request.REQUEST:
if 'province' not in request.GET:
raise SuspiciousOperation
province = request.REQUEST['province']
province = request.GET['province']
options = city_options(province)
return HttpResponse(SchoolSelect().render_options(options, []))


@require_GET
@enforce_condition(not_anonymous)
def schools_view(request):
if 'province' not in request.REQUEST or 'city' not in request.REQUEST:
if 'province' not in request.GET or 'city' not in request.GET:
raise SuspiciousOperation
province = request.REQUEST['province']
city = request.REQUEST['city']
province = request.GET['province']
city = request.GET['city']
options = school_options(province, city)
return HttpResponse(SchoolSelect().render_options(options, []))

Expand Down

0 comments on commit 3e17e46

Please sign in to comment.