Skip to content

Commit a43e89d

Browse files
committed
⬆️ Django 5.2
1 parent 8f040e6 commit a43e89d

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

.github/workflows/build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
strategy:
77
matrix:
88
python-version: ["3.12"]
9-
django-version: [4.2]
9+
django-version: [5.2]
1010
steps:
1111
- uses: actions/checkout@v6
1212

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2.5.0
2+
====================
3+
* Adds compatibility with Django 5.2
4+
15
2.4.0 (2023-08-01)
26
====================
37
* Removed django-jenkins

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ WHEEL_VERSION ?= 0.45.1
77
PIP_VERSION ?= 25.3
88
MAX_COMPLEXITY ?= 12
99
PY_DIRS ?= $(APP)
10-
DJANGO ?= "Django==4.2.13"
10+
DJANGO ?= "Django==5.2.9"
1111

1212
FLAKE8 ?= $(VE)/bin/flake8
1313
PIP ?= $(VE)/bin/pip

courseaffils/middleware.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def process_request(self, request, override_view=None):
144144
if request.user.is_staff or \
145145
CourseAccess.allowed(request) or \
146146
(request.user in course.members):
147-
request.session[SESSION_KEY] = course
147+
request.session[SESSION_KEY] = course.pk
148148
self.decorate_request(request, course)
149149

150150
if 'next' in request.GET:
@@ -153,7 +153,8 @@ def process_request(self, request, override_view=None):
153153
return None
154154

155155
if SESSION_KEY in request.session:
156-
course = request.session[SESSION_KEY]
156+
course_pk = request.session[SESSION_KEY]
157+
course = get_object_or_404(Course, pk=course_pk)
157158
self.decorate_request(request, course)
158159
return None
159160

0 commit comments

Comments
 (0)