From: Guillaume Pellerin Date: Thu, 4 Feb 2016 00:36:18 +0000 (+0100) Subject: fix pdf X-Git-Tag: 1.1~114 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=421c714de6547d92b7bcdad03bf9cd4cf6dac36b;p=teleforma.git fix pdf --- diff --git a/teleforma/urls.py b/teleforma/urls.py index c49a4bff..cb205dfe 100644 --- a/teleforma/urls.py +++ b/teleforma/urls.py @@ -58,8 +58,8 @@ urlpatterns = patterns('', # (r'^accounts/register0/$', RegistrationView.as_view(), {'form_class':CustomRegistrationForm}), url(r'^accounts/register/$', UserAddView.as_view(), name="teleforma-register"), url(r'^accounts/register/(?P.*)/complete/$', UserCompleteView.as_view(), name="teleforma-register-complete"), - url(r'^accounts/register/(?P.*)/download/\?format=pdf', RegistrationPDFViewDownload.as_view(), name="teleforma-registration-download"), - url(r'^accounts/register/(?P.*)/view/\?format=pdf', RegistrationPDFView.as_view(), name="teleforma-registration-view"), + url(r'^accounts/register/(?P.*)/download/$', RegistrationPDFViewDownload.as_view(), name="teleforma-registration-download"), + url(r'^accounts/register/(?P.*)/view/$', RegistrationPDFView.as_view(), name="teleforma-registration-view"), url(r'^captcha/', include('captcha.urls')), diff --git a/teleforma/views/crfpa.py b/teleforma/views/crfpa.py index 093c70fc..bd2aa642 100644 --- a/teleforma/views/crfpa.py +++ b/teleforma/views/crfpa.py @@ -435,6 +435,9 @@ class RegistrationPDFView(PDFTemplateResponseMixin, TemplateView): template_name = 'registration/registration_pdf.html' pdf_template_name = template_name + def is_pdf(self): + return True + def get_context_data(self, **kwargs): context = super(RegistrationPDFView, self).get_context_data(**kwargs) user = User.objects.get(username=kwargs['username'])