Skip to content

Commit

Permalink
patch: check if observation pk is completely absent (#1094)
Browse files Browse the repository at this point in the history
  • Loading branch information
tinashechiraya authored Oct 8, 2024
1 parent 08c9e37 commit 6695e36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_project/monitor/observation_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ def get_queryset(self):
return ObservationPestImage.objects.none()

observation_pk = self.kwargs.get('observation_pk')
if not observation_pk:
if observation_pk is None:
raise ValueError("Missing 'observation_pk' in URL")

observation = get_object_or_404(Observations, pk=observation_pk)
Expand Down

0 comments on commit 6695e36

Please sign in to comment.