+ if settings.FORCE_HTTPS_LINKS or request.is_secure():
+ context['scheme'] = 'https'
+ else:
+ context['scheme'] = 'http'
+ response = HttpResponse(content_type = "text/plain")
+ response['Content-Disposition'] = 'attachment; filename=.pwclientrc'
+ response.write(render_to_string('patchwork/pwclientrc', context))
+ return response
+
+def pwclient(request):
+ context = PatchworkRequestContext(request)
+ response = HttpResponse(content_type = "text/x-python")
+ response['Content-Disposition'] = 'attachment; filename=pwclient'
+ response.write(render_to_string('patchwork/pwclient', context))
+ return response
+
+def confirm(request, key):
+ import patchwork.views.user, patchwork.views.mail
+ views = {
+ 'userperson': patchwork.views.user.link_confirm,
+ 'registration': patchwork.views.user.register_confirm,
+ 'optout': patchwork.views.mail.optout_confirm,
+ 'optin': patchwork.views.mail.optin_confirm,
+ }
+
+ conf = get_object_or_404(EmailConfirmation, key = key)
+ if conf.type not in views:
+ raise Http404