Skip to content

Commit 1dff905

Browse files
committed
WIP: Another django 5.2 fix
1 parent 0e4d53c commit 1dff905

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2.5.1
2+
====================
3+
* Add another Django 5.2 fix
4+
15
2.5.0 (2025-12-08)
26
====================
37
* Adds compatibility with Django 5.2

courseaffils/lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def in_course_or_404(username, group_or_course):
4747
raise Http404(response_body)
4848

4949

50-
ANONYMIZE_KEY = 'ccnmtl.courseaffils.anonymize'
50+
ANONYMIZE_KEY = 'ctl.courseaffils.anonymize'
5151

5252

5353
def handle_public_name(user, request):

courseaffils/middleware.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
except ImportError:
2525
pass
2626

27-
SESSION_KEY = 'ccnmtl.courseaffils.course'
27+
SESSION_KEY = 'ctl.courseaffils.course'
2828

2929

3030
def has_anonymous_path(current_path):
@@ -178,7 +178,7 @@ def process_request(self, request, override_view=None):
178178

179179
if chosen_course and \
180180
(chosen_course in available_courses or request.user.is_staff):
181-
request.session[SESSION_KEY] = chosen_course
181+
request.session[SESSION_KEY] = chosen_course.pk
182182
self.decorate_request(request, chosen_course)
183183
return None
184184

courseaffils/tests/test_middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class StubRequest(object):
1818
def __init__(self, c):
1919
self.path = "/foo/bar"
2020
if c:
21-
self.session = {'ccnmtl.courseaffils.course': c}
21+
self.session = {'ctl.courseaffils.course': c}
2222
else:
2323
self.session = dict()
2424

courseaffils/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from django.utils.http import urlquote as quote
1919

2020

21-
SESSION_KEY = 'ccnmtl.courseaffils.course'
21+
SESSION_KEY = 'ctl.courseaffils.course'
2222

2323

2424
def get_courses_for_user(user):

0 commit comments

Comments
 (0)