Skip to content

Commit

Permalink
Pregenerate link url
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick11514 committed Oct 9, 2024
1 parent cd5a23c commit 98ed3ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/views.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from collections import defaultdict

import django.http
from django.shortcuts import get_object_or_404
from django.shortcuts import get_object_or_404, resolve_url
from django.http import HttpRequest, HttpResponseBadRequest
from django.views.decorators.http import require_POST
from django.contrib.auth.models import User
from django.urls import reverse
from common.models import (
Submit,
Class,
Expand Down Expand Up @@ -97,6 +96,7 @@ def tasks_list_all(request: HttpRequest, subject_abbr: str | None = None):
"path": task.code,
"subject": task.subject.abbr,
"date": task.created_at,
"link": resolve_url("teacher_task", task_id=task.pk)
}
)
return JsonResponse({"tasks": result, "count": allCount})
Expand Down

0 comments on commit 98ed3ff

Please sign in to comment.