Deprecation fixes: Use request.GET or request.POST as appropriate, instead of request.REQUEST.

- Legacy-Id: 12533
This commit is contained in:
Henrik Levkowetz 2016-12-15 13:21:33 +00:00
parent ff9b8a9bdb
commit 17a7f59cd6
4 changed files with 12 additions and 8 deletions

View file

@ -769,7 +769,7 @@ def approve_ballot(request, name):
if ballot_writeup_event.pk == None:
ballot_writeup_event.save()
if new_state.slug == "ann" and new_state.slug != prev_state.slug and not request.REQUEST.get("skiprfceditorpost"):
if new_state.slug == "ann" and new_state.slug != prev_state.slug and not request.POST.get("skiprfceditorpost"):
# start by notifying the RFC Editor
import ietf.sync.rfceditor
response, error = ietf.sync.rfceditor.post_approved_draft(settings.RFC_EDITOR_SYNC_NOTIFICATION_URL, doc.name)

View file

@ -1152,7 +1152,7 @@ def request_publication(request, name):
if form.is_valid():
events = []
if not request.REQUEST.get("skiprfceditorpost"):
if not request.POST.get("skiprfceditorpost"):
# start by notifying the RFC Editor
import ietf.sync.rfceditor
response, error = ietf.sync.rfceditor.post_approved_draft(settings.RFC_EDITOR_SYNC_NOTIFICATION_URL, doc.name)

View file

@ -96,7 +96,7 @@ def materials(request, num=None):
cut_off_date = meeting.get_submission_cut_off_date()
cor_cut_off_date = meeting.get_submission_correction_date()
now = datetime.date.today()
if settings.SERVER_MODE != 'production' and '_testoverride' in request.REQUEST:
if settings.SERVER_MODE != 'production' and '_testoverride' in request.GET:
pass
elif now > cor_cut_off_date:
return render(request, "meeting/materials_upload_closed.html", {

View file

@ -17,14 +17,18 @@ def redirect(request, path="", script=""):
#
# First look for flag items, stored in the database
# as a command with a leading "^".
if request.method == 'POST':
rparam = request.POST
else:
rparam = request.GET
for flag in redir.commands.all().filter(command__startswith='^'):
fc = flag.command[1:].split("^")
if len(fc) > 1:
if request.REQUEST.get('command') != fc[1]:
if rparam.get('command') != fc[1]:
continue
if request.REQUEST.has_key(fc[0]):
if rparam.has_key(fc[0]):
remove_args.append(fc[0])
num = re.match('(\d+)', request.REQUEST[fc[0]])
num = re.match('(\d+)', rparam[fc[0]])
if (num and int(num.group(1))) or (num is None):
cmd = flag
break
@ -33,7 +37,7 @@ def redirect(request, path="", script=""):
# for an exact match for the command= parameter.
if cmd is None:
try:
cmd = redir.commands.all().get(command=request.REQUEST['command'])
cmd = redir.commands.all().get(command=rparam['command'])
except Command.DoesNotExist:
pass # it's ok, there's no more-specific request.
except KeyError:
@ -58,7 +62,7 @@ def redirect(request, path="", script=""):
# contains non-ASCII characters. The old scripts didn't support
# non-ASCII characters anyway, so there's no need to handle
# them fully correctly in these redirects.
url += str(rest % request.REQUEST)
url += str(rest % rparam)
url += "/"
except:
# rest had something in it that request didn't have, so just