]> git.parisson.com Git - teleforma.git/commitdiff
fix no user after registration 2.14.1
authorGuillaume Pellerin <guillaume.pellerin@parisson.com>
Thu, 26 Jun 2025 07:31:02 +0000 (09:31 +0200)
committerGuillaume Pellerin <guillaume.pellerin@parisson.com>
Thu, 26 Jun 2025 07:31:02 +0000 (09:31 +0200)
pyproject.toml
setup.py
teleforma/__init__.py
teleforma/views/crfpa.py

index 4dd7217070ed92b7eec715a4313a80c683f1f596..6a0c8609da7ef193ff47bada88a3ff69ac4f2811 100644 (file)
@@ -1,6 +1,6 @@
 [tool.poetry]
 name = "teleforma"
-version = "2.8.0"
+version = "2.14.1"
 description = "e-learning platform based on streaming"
 authors = ["Guillaume Pellerin <guillaume.pellerin@parisson.com>"]
 license = "CeCILL v2"
index 2e0ea35400225c1c9308e57feed7eb7654f9f2b7..b6722329f5e7c3d166e597b855a99680febff357 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ setup(
   long_description = open('README.rst').read(),
   author = "Guillaume Pellerin",
   author_email = "yomguy@parisson.com",
-  version = '2.14.0',
+  version = '2.14.1',
   platforms=['OS Independent'],
   license='CeCILL v2',
   classifiers = CLASSIFIERS,
index 4ed0b2dd91da45424ef9979909c5f3b00a3a31f7..0ab1501459b8fd8629798be2d08133e585d3338c 100644 (file)
@@ -9,7 +9,7 @@ U{http://parisson.com/products/teleforma}
 """
 
 __docformat__ = 'epytext en'
-__version__ = '2.14.0'
+__version__ = '2.14.1'
 __url__ = 'https://github.com/Parisson/TeleForma'
 __copyright__ = '(C) 2011-2024 Parisson'
 __license__ = 'CeCILL-v2'
index f28fe8e7ab11b500ba9e8921388b9a70a8b196a3..384955c819e0d360019f151dda682d5354b27b7e 100644 (file)
@@ -67,7 +67,7 @@ from ..models.core import Course, CourseType, Document, NamePaginator, Period
 from ..models.crfpa import (IEJ, Discount, NewsItem, Parameters, Payback,
                             Payment, Profile, Student, Training, months_choices, payment_choices)
 from ..views.core import (CourseAccessMixin, PDFTemplateResponseMixin, format_courses,
-                          get_courses, get_periods)
+                          get_courses, get_periods, get_default_period)
 from ..views.profile import ProfileView
 
 def get_course_code(obj):
@@ -764,9 +764,16 @@ class UserCompleteView(TemplateView):
         context = super(UserCompleteView, self).get_context_data(**kwargs)
         # context['register_doc_print'] = Document.objects.get(id=settings.TELEFORMA_REGISTER_DEFAULT_DOC_ID)
         context['username'] = kwargs['username']
-        user = User.objects.get(username=kwargs['username'])
-        student = user.student.all()[0]
-        context['period'] = student.period
+        user = None
+        try:
+            user = User.objects.get(username=kwargs['username'])
+        except:
+            user = self.request.user
+        if user:
+            student = user.student.all()[0]
+            context['period'] = student.period
+        else:
+            context['period'] = get_default_period()
         return context