Skip to content

Commit c43688f

Browse files
chore: make upgrade (#226)
* chore: make upgrade Upgrade all python dependencies using `make upgrade`. This also fixes the `make compile-requirements` process; it was previously broken with unresolvable dependencies. * fix: fix minor bugs caught by updated type checker - `backend.get_thread` can return None. Unlikely in this case, but possible if the thread was somehow deleted before being retrieved again. - returning group_ids at the end of `get_group_ids_from_params` could result in an unexpected type and value being returned, depending on what sanitation has been done on the params.
1 parent af0949b commit c43688f

File tree

10 files changed

+889
-505
lines changed

10 files changed

+889
-505
lines changed

forum/api/threads.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,11 @@ def update_thread(
262262
)
263263
backend.update_thread(thread_id, **update_thread_data)
264264
thread = backend.get_thread(thread_id)
265+
if thread is None:
266+
log.error(
267+
"Forumv2RequestError for update thread request - retrieving updated thread to send in response."
268+
)
269+
raise ForumV2RequestError(f"Thread no longer exists with Id: {thread_id}")
265270

266271
try:
267272
return prepare_thread_api_response(

forum/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def get_handler_by_name(name: str) -> Signal:
127127

128128

129129
def prepare_comment_data_for_get_children(
130-
children: list[dict[str, Any]]
130+
children: list[dict[str, Any]],
131131
) -> list[dict[str, Any]]:
132132
"""Prepare children data to be used in serializer."""
133133
children_data = []
@@ -174,15 +174,15 @@ def get_group_ids_from_params(params: dict[str, Any]) -> list[int]:
174174
"""
175175
if "group_id" in params and "group_ids" in params:
176176
raise ValueError("Cannot specify both group_id and group_ids")
177-
group_ids: str | list[str] = []
178177
if group_id := params.get("group_id"):
179178
return [int(group_id)]
180179
elif group_ids := params.get("group_ids", []):
181180
if isinstance(group_ids, str):
182181
return [int(x) for x in group_ids.split(",")]
183182
elif isinstance(group_ids, list):
184183
return [int(x) for x in group_ids]
185-
return group_ids
184+
# if it's not a str or list, it's invalid, so drop it.
185+
return []
186186

187187

188188
def get_commentable_ids_from_params(params: dict[str, Any]) -> list[str]:

requirements/base.txt

Lines changed: 51 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,31 @@
44
#
55
# make upgrade
66
#
7-
amqp==5.2.0
7+
amqp==5.3.1
88
# via kombu
99
annotated-types==0.7.0
1010
# via pydantic
11-
asgiref==3.8.1
11+
asgiref==3.9.1
1212
# via django
13-
attrs==24.2.0
13+
attrs==25.3.0
1414
# via openedx-events
15-
beautifulsoup4==4.12.3
15+
beautifulsoup4==4.13.5
1616
# via -r requirements/base.in
1717
billiard==4.2.1
1818
# via celery
1919
camel-converter[pydantic]==4.0.1
2020
# via meilisearch
21-
celery==5.4.0
21+
celery==5.5.3
2222
# via event-tracking
23-
certifi==2024.8.30
23+
certifi==2025.8.3
2424
# via
2525
# elasticsearch
2626
# requests
2727
cffi==1.17.1
2828
# via pynacl
29-
charset-normalizer==3.4.0
29+
charset-normalizer==3.4.3
3030
# via requests
31-
click==8.1.7
31+
click==8.2.1
3232
# via
3333
# celery
3434
# click-didyoumean
@@ -38,15 +38,15 @@ click==8.1.7
3838
# edx-django-utils
3939
click-didyoumean==0.3.1
4040
# via celery
41-
click-plugins==1.1.1
41+
click-plugins==1.1.1.2
4242
# via celery
4343
click-repl==0.3.0
4444
# via celery
45-
code-annotations==1.8.0
45+
code-annotations==2.3.0
4646
# via edx-toggles
47-
django==4.2.16
47+
django==4.2.23
4848
# via
49-
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
49+
# -c https:/raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
5050
# -r requirements/base.in
5151
# django-crum
5252
# django-waffle
@@ -60,71 +60,69 @@ django-crum==0.7.9
6060
# via
6161
# edx-django-utils
6262
# edx-toggles
63-
django-waffle==4.1.0
63+
django-waffle==5.0.0
6464
# via
6565
# edx-django-utils
6666
# edx-toggles
67-
djangorestframework==3.15.2
67+
djangorestframework==3.16.1
6868
# via -r requirements/base.in
6969
dnspython==2.7.0
7070
# via pymongo
71-
edx-ccx-keys==1.3.0
71+
edx-ccx-keys==2.0.2
7272
# via openedx-events
73-
edx-django-utils==7.0.0
73+
edx-django-utils==8.0.0
7474
# via
7575
# edx-toggles
7676
# event-tracking
7777
# openedx-events
78-
edx-opaque-keys[django]==2.11.0
78+
edx-opaque-keys[django]==3.0.0
7979
# via
8080
# edx-ccx-keys
8181
# openedx-events
82-
edx-search==4.1.1
82+
edx-search==4.1.3
8383
# via -r requirements/base.in
84-
edx-toggles==5.2.0
84+
edx-toggles==5.4.1
8585
# via
8686
# edx-search
8787
# event-tracking
8888
elasticsearch==7.13.4
8989
# via
90-
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
90+
# -c https:/raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
9191
# -r requirements/base.in
9292
# edx-search
93-
event-tracking==3.0.0
93+
event-tracking==3.3.0
9494
# via edx-search
95-
fastavro==1.9.7
95+
fastavro==1.12.0
9696
# via openedx-events
9797
idna==3.10
9898
# via requests
99-
jinja2==3.1.4
99+
jinja2==3.1.6
100100
# via code-annotations
101-
kombu==5.4.2
101+
kombu==5.5.4
102102
# via celery
103103
markupsafe==3.0.2
104104
# via jinja2
105-
meilisearch==0.31.6
105+
meilisearch==0.37.0
106106
# via edx-search
107-
mysqlclient==2.2.5
107+
mysqlclient==2.2.7
108108
# via -r requirements/base.in
109-
newrelic==10.2.0
110-
# via edx-django-utils
111-
openedx-atlas==0.6.2
109+
openedx-atlas==0.7.0
112110
# via -r requirements/base.in
113-
openedx-events==9.15.0
111+
openedx-events==10.5.0
114112
# via event-tracking
115-
pbr==6.1.0
116-
# via stevedore
117-
prompt-toolkit==3.0.48
113+
packaging==25.0
114+
# via kombu
115+
prompt-toolkit==3.0.52
118116
# via click-repl
119-
psutil==6.1.0
117+
psutil==7.0.0
120118
# via edx-django-utils
121119
pycparser==2.22
122120
# via cffi
123-
pydantic==2.9.2
121+
pydantic==2.11.7
124122
# via camel-converter
125-
pydantic-core==2.23.4
123+
pydantic-core==2.33.2
126124
# via pydantic
127-
pymongo==4.4.0
125+
pymongo==4.14.1
128126
# via
129127
# -r requirements/base.in
130128
# edx-opaque-keys
@@ -135,39 +133,41 @@ python-dateutil==2.9.0.post0
135133
# via celery
136134
python-slugify==8.0.4
137135
# via code-annotations
138-
pytz==2024.2
136+
pytz==2025.2
139137
# via event-tracking
140138
pyyaml==6.0.2
141139
# via code-annotations
142-
requests==2.32.3
140+
requests==2.32.5
143141
# via
144142
# -r requirements/base.in
145143
# meilisearch
146-
six==1.16.0
144+
six==1.17.0
147145
# via
148146
# edx-ccx-keys
149147
# event-tracking
150148
# python-dateutil
151-
soupsieve==2.6
149+
soupsieve==2.8
152150
# via beautifulsoup4
153-
sqlparse==0.5.1
151+
sqlparse==0.5.3
154152
# via django
155-
stevedore==5.3.0
153+
stevedore==5.5.0
156154
# via
157155
# code-annotations
158156
# edx-django-utils
159157
# edx-opaque-keys
160158
text-unidecode==1.3
161159
# via python-slugify
162-
typing-extensions==4.12.2
160+
typing-extensions==4.15.0
163161
# via
162+
# beautifulsoup4
164163
# edx-opaque-keys
165164
# pydantic
166165
# pydantic-core
167-
tzdata==2024.2
168-
# via
169-
# celery
170-
# kombu
166+
# typing-inspection
167+
typing-inspection==0.4.1
168+
# via pydantic
169+
tzdata==2025.2
170+
# via kombu
171171
urllib3==1.26.20
172172
# via
173173
# elasticsearch
@@ -179,3 +179,6 @@ vine==5.1.0
179179
# kombu
180180
wcwidth==0.2.13
181181
# via prompt-toolkit
182+
183+
# The following packages are considered to be unsafe in a requirements file:
184+
# setuptools

0 commit comments

Comments
 (0)