summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--patchwork/requestcontext.py8
-rw-r--r--patchwork/views/__init__.py12
2 files changed, 15 insertions, 5 deletions
diff --git a/patchwork/requestcontext.py b/patchwork/requestcontext.py
index 3b1afaf..342d380 100644
--- a/patchwork/requestcontext.py
+++ b/patchwork/requestcontext.py
@@ -56,7 +56,13 @@ class PatchworkRequestContext(RequestContext):
if list_view:
params = self.filters.params()
for param in ['order', 'page']:
- value = request.REQUEST.get(param, None)
+ data = {}
+ if request.method == 'GET':
+ data = request.GET
+ elif request.method == 'POST':
+ data = request.POST
+
+ value = data.get(param, None)
if value:
params.append((param, value))
self.update({
diff --git a/patchwork/views/__init__.py b/patchwork/views/__init__.py
index cb05a8e..b64f604 100644
--- a/patchwork/views/__init__.py
+++ b/patchwork/views/__init__.py
@@ -50,15 +50,19 @@ def generic_list(request, project, view,
list_view_params = view_args)
context.project = project
- order = Order(request.REQUEST.get('order'), editable = editable_order)
+ data = {}
+ if request.method == 'GET':
+ data = request.GET
+ elif request.method == 'POST':
+ data = request.POST
+ order = Order(data.get('order'), editable=editable_order)
# Explicitly set data to None because request.POST will be an empty dict
# when the form is not submitted, but passing a non-None data argument to
# a forms.Form will make it bound and we don't want that to happen unless
# there's been a form submission.
- data = None
- if request.method == 'POST':
- data = request.POST
+ if request.method != 'POST':
+ data = None
user = request.user
properties_form = None
if project.is_editable(user):