mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2024-12-28 16:12:13 +00:00
add announcement visible filter
This commit is contained in:
parent
30b3e1e22f
commit
e32ef06eeb
@ -61,4 +61,6 @@ class AnnouncementAdminAPIView(APIView):
|
||||
except Announcement.DoesNotExist:
|
||||
return self.error(_("Announcement does not exist"))
|
||||
announcement = Announcement.objects.all().order_by("-create_time")
|
||||
if request.GET.get("visible") == "true":
|
||||
announcement = announcement.filter(visible=True)
|
||||
return self.success(paginate_data(request, announcement, AnnouncementSerializer))
|
||||
|
Loading…
Reference in New Issue
Block a user