Skip to content

Commit 17a7f59

Browse files
committed
Deprecation fixes: Use request.GET or request.POST as appropriate, instead of request.REQUEST.
- Legacy-Id: 12533
1 parent ff9b8a9 commit 17a7f59

4 files changed

Lines changed: 12 additions & 8 deletions

File tree

ietf/doc/views_ballot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ def approve_ballot(request, name):
769769
if ballot_writeup_event.pk == None:
770770
ballot_writeup_event.save()
771771

772-
if new_state.slug == "ann" and new_state.slug != prev_state.slug and not request.REQUEST.get("skiprfceditorpost"):
772+
if new_state.slug == "ann" and new_state.slug != prev_state.slug and not request.POST.get("skiprfceditorpost"):
773773
# start by notifying the RFC Editor
774774
import ietf.sync.rfceditor
775775
response, error = ietf.sync.rfceditor.post_approved_draft(settings.RFC_EDITOR_SYNC_NOTIFICATION_URL, doc.name)

ietf/doc/views_draft.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ def request_publication(request, name):
11521152
if form.is_valid():
11531153
events = []
11541154

1155-
if not request.REQUEST.get("skiprfceditorpost"):
1155+
if not request.POST.get("skiprfceditorpost"):
11561156
# start by notifying the RFC Editor
11571157
import ietf.sync.rfceditor
11581158
response, error = ietf.sync.rfceditor.post_approved_draft(settings.RFC_EDITOR_SYNC_NOTIFICATION_URL, doc.name)

ietf/meeting/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def materials(request, num=None):
9696
cut_off_date = meeting.get_submission_cut_off_date()
9797
cor_cut_off_date = meeting.get_submission_correction_date()
9898
now = datetime.date.today()
99-
if settings.SERVER_MODE != 'production' and '_testoverride' in request.REQUEST:
99+
if settings.SERVER_MODE != 'production' and '_testoverride' in request.GET:
100100
pass
101101
elif now > cor_cut_off_date:
102102
return render(request, "meeting/materials_upload_closed.html", {

ietf/redirects/views.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,18 @@ def redirect(request, path="", script=""):
1717
#
1818
# First look for flag items, stored in the database
1919
# as a command with a leading "^".
20+
if request.method == 'POST':
21+
rparam = request.POST
22+
else:
23+
rparam = request.GET
2024
for flag in redir.commands.all().filter(command__startswith='^'):
2125
fc = flag.command[1:].split("^")
2226
if len(fc) > 1:
23-
if request.REQUEST.get('command') != fc[1]:
27+
if rparam.get('command') != fc[1]:
2428
continue
25-
if request.REQUEST.has_key(fc[0]):
29+
if rparam.has_key(fc[0]):
2630
remove_args.append(fc[0])
27-
num = re.match('(\d+)', request.REQUEST[fc[0]])
31+
num = re.match('(\d+)', rparam[fc[0]])
2832
if (num and int(num.group(1))) or (num is None):
2933
cmd = flag
3034
break
@@ -33,7 +37,7 @@ def redirect(request, path="", script=""):
3337
# for an exact match for the command= parameter.
3438
if cmd is None:
3539
try:
36-
cmd = redir.commands.all().get(command=request.REQUEST['command'])
40+
cmd = redir.commands.all().get(command=rparam['command'])
3741
except Command.DoesNotExist:
3842
pass # it's ok, there's no more-specific request.
3943
except KeyError:
@@ -58,7 +62,7 @@ def redirect(request, path="", script=""):
5862
# contains non-ASCII characters. The old scripts didn't support
5963
# non-ASCII characters anyway, so there's no need to handle
6064
# them fully correctly in these redirects.
61-
url += str(rest % request.REQUEST)
65+
url += str(rest % rparam)
6266
url += "/"
6367
except:
6468
# rest had something in it that request didn't have, so just

0 commit comments

Comments
 (0)