Skip to content

Commit

Permalink
- fixed a bug when NEMO would throw error 500 instead of return a bad…
Browse files Browse the repository at this point in the history
… request when an exception happens when looking up comments and tasks
  • Loading branch information
rptmat57 committed Sep 6, 2024
1 parent 4a84b25 commit 45e6bab
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions NEMO/views/tool_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,13 +580,13 @@ def do_exit_wait_list(entry, time):
@login_required
@require_GET
def past_comments_and_tasks(request):
user: User = request.user
start, end = extract_optional_beginning_and_end_times(request.GET)
search = request.GET.get("search")
if not start and not end and not search:
return HttpResponseBadRequest("Please enter a search keyword, start date or end date.")
tool_id = request.GET.get("tool_id")
try:
user: User = request.user
start, end = extract_optional_beginning_and_end_times(request.GET)
search = request.GET.get("search")
if not start and not end and not search:
return HttpResponseBadRequest("Please enter a search keyword, start date or end date.")
tool_id = request.GET.get("tool_id")
tasks = Task.objects.filter(tool_id=tool_id)
comments = Comment.objects.filter(tool_id=tool_id)
if not user.is_staff:
Expand Down

0 comments on commit 45e6bab

Please sign in to comment.