From: Guillaume Pellerin Date: Thu, 4 Feb 2016 11:55:22 +0000 (+0100) Subject: fix various post registration field X-Git-Tag: 1.1~79 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=bf7202a2a1e5a865a172c12efa6402a657272b4c;p=teleforma.git fix various post registration field --- diff --git a/teleforma/views/crfpa.py b/teleforma/views/crfpa.py index 857c9457..64e34922 100644 --- a/teleforma/views/crfpa.py +++ b/teleforma/views/crfpa.py @@ -411,10 +411,9 @@ class UserAddView(CreateWithInlinesView): user = form.save() user.username = username user.last_name = last_name.upper() - user.first_name.capitalize() + user.first_name = first_name.capitalize() user.is_active = False user.save() - # period = inlines[1].cleaned_data['period'] return super(UserAddView, self).forms_valid(form, inlines) @@ -456,10 +455,14 @@ class RegistrationPDFView(PDFTemplateResponseMixin, TemplateView): if not student.oral_2: student.oral_2 = Course.objects.get(code='X') student.save() + profile = user.profile.all()[0] if profile.city: profile.city = profile.city.upper() - profile.save() + if profile.country: + profile.country = profile.country.upper() + profile.save() + context['student'] = student return context