]> git.parisson.com Git - teleforma.git/commitdiff
fix various post registration field
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 4 Feb 2016 11:55:22 +0000 (12:55 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 4 Feb 2016 11:55:22 +0000 (12:55 +0100)
teleforma/views/crfpa.py

index 857c94571e32abc28df11a973c696f15b430dced..64e349221395f9043743ce488839e768cc975c65 100644 (file)
@@ -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