Skip to content

Commit e75f174

Browse files
committed
Merge branch 'develop' – Pin numpy to 1.x
2 parents 7bab620 + 82bf380 commit e75f174

File tree

3 files changed

+44
-49
lines changed

3 files changed

+44
-49
lines changed

api/drf_views.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,11 @@ def get_object(self):
223223
# NOTE: kwargs is accepting pk for now
224224
# TODO: Can kwargs be other than pk??
225225
pk = self.kwargs["pk"]
226-
country = get_object_or_404(Country, pk=int(pk))
227-
return self.get_queryset().filter(id=country.id).first()
226+
try:
227+
country = get_object_or_404(Country, pk=int(pk))
228+
return self.get_queryset().filter(id=country.id).first()
229+
except ValueError:
230+
raise Exception("An error occured", "Country key is unusable", pk)
228231

229232
def get_serializer_class(self):
230233
if self.request.GET.get("mini", "false").lower() == "true":

poetry.lock

Lines changed: 38 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ graphql-core = "^2.0"
5757
gunicorn = "==22.0.0"
5858
lxml = "==4.9.1"
5959
nltk = "^3.8.1"
60+
numpy = "<2.0.0"
6061
opencensus-ext-azure = "==1.0.7"
6162
opencensus-ext-django = "==0.7.4"
6263
pandas = "==1.3.5"

0 commit comments

Comments
 (0)