From 6fa81606a78f3dcc3160c0117be378bb861b1ded Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Fri, 19 Mar 2010 15:56:04 +0800 Subject: views: Use request scheme in sample pwclientrc file. Adapt the pwclientrc file to suit the current scheme in use. Signed-off-by: Jeremy Kerr --- apps/patchwork/views/base.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apps') diff --git a/apps/patchwork/views/base.py b/apps/patchwork/views/base.py index 338c673..bb78fa4 100644 --- a/apps/patchwork/views/base.py +++ b/apps/patchwork/views/base.py @@ -47,6 +47,10 @@ def pwclientrc(request, project_id): project = get_object_or_404(Project, linkname = project_id) context = PatchworkRequestContext(request) context.project = project + if request.is_secure(): + context['scheme'] = 'https' + else: + context['scheme'] = 'http' response = HttpResponse(mimetype = "text/plain") response['Content-Disposition'] = 'attachment; filename=.pwclientrc' response.write(render_to_string('patchwork/pwclientrc', context)) -- cgit v1.2.3