From: Guillaume Pellerin Date: Wed, 3 Feb 2016 23:48:56 +0000 (+0100) Subject: use username X-Git-Tag: 1.1~128 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=d44a4efb89dc8ddc1b0ae2d73a5e2993a60a5858;p=teleforma.git use username --- diff --git a/teleforma/templates/registration/registration_pdf.html b/teleforma/templates/registration/registration_pdf.html index 79f0e1ae..464458db 100644 --- a/teleforma/templates/registration/registration_pdf.html +++ b/teleforma/templates/registration/registration_pdf.html @@ -42,9 +42,9 @@ {% trans "Birthday" %} : {{ profile.birthday }} {% trans "Level" %} : {{ student.level }} - {% trans "IEJ" %} : {{ student.eij }} + {% trans "IEJ" %} : {{ student.eij.name }} {% trans "Training" %} : {{ student.training.name }} - {% trans "Training type" %} : {% if student.platform_only %}E-learning{% else %}Présentielle et E-learning{% endif %} + {% trans "Training type" %} : {% if student.platform_only %}E-learning seulement{% else %}Présentielle et E-learning{% endif %} {% trans "Matière de procédure" %} : {{ student.procedure }} {% trans "Matière juridique de spécialité" %} : {{ student.written_speciality }} {% trans "Matière d'oral de spécialité" %} : {{ student.oral_speciality }} @@ -57,6 +57,7 @@

Je certifie avoir pris connaissance des conditions générales d’inscription et du règlement intérieur.

+
diff --git a/teleforma/urls.py b/teleforma/urls.py index b489b76d..cda9d049 100644 --- a/teleforma/urls.py +++ b/teleforma/urls.py @@ -59,7 +59,7 @@ urlpatterns = patterns('', url(r'^accounts/register/$', UserAddView.as_view(), name="teleforma-register"), url(r'^accounts/complete/$', UserCompleteView.as_view(), name="teleforma-register-complete"), 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'^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 5a2cdde1..a59d1c7d 100644 --- a/teleforma/views/crfpa.py +++ b/teleforma/views/crfpa.py @@ -423,16 +423,15 @@ class UserCompleteView(TemplateView): return context -class RegistrationPDFView(PDFTemplateResponseMixin, DetailView): +class RegistrationPDFView(PDFTemplateResponseMixin, TemplateView): - model = User template_name = 'registration/registration_pdf.html' pdf_template_name = template_name def get_context_data(self, **kwargs): context = super(RegistrationPDFView, self).get_context_data(**kwargs) - # user = User.objects.get(pk=kwargs['pk']) - user = self.get_object() + user = User.objects.get(username=kwargs['username']) + # user = self.get_object() student = user.student.all()[0] if student.training and not student.trainings.all(): student.trainings.add(student.training) @@ -448,7 +447,8 @@ class RegistrationPDFViewDownload(RegistrationPDFView): def get_pdf_filename(self): super(RegistrationPDFViewDownload, self).get_pdf_filename() - user = self.get_object() + user = User.objects.get(username=kwargs['username']) + # user = self.get_object() student = user.student.all()[0] prefix = unicode(_('Registration')) filename = '_'.join([prefix, student.user.first_name, student.user.last_name])