X-Git-Url: https://git.ozlabs.org/?p=patchwork;a=blobdiff_plain;f=patchwork%2Fviews%2F__init__.py;fp=patchwork%2Fviews%2F__init__.py;h=b64f6041eca006bb800f190c0b2183f5e9b3c3ac;hp=cb05a8ec7dc9e0ea619b9952eaf99744f8ea2d43;hb=15a0fe8ac4870f910acb0e2241b999271afa114a;hpb=41d5ceb82b5d4297570b73639517b642fab0c45f 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):