Skip to content

Commit

Permalink
attempt to do issue 246
Browse files Browse the repository at this point in the history
  • Loading branch information
ohi-711 committed Feb 6, 2024
1 parent 1bbc931 commit 22fab55
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions core/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
path("auth/token", TokenObtainPairView.as_view(), name="api_token_obtain_pair"),
path("auth/token/refresh", TokenRefreshView.as_view(), name="api_token_refresh"),
path("notifications/new", NotificationsNew.as_view(), name="api_notification_new"),
path("announcements", announcement, name="api_all_announcements"),
path("announcements/feed", announcementFeed, name="api_announcement_feed"),
path("announcements", AnnouncementListAll.as_view(), name="api_all_announcements"),
path("announcements/feed", AnnouncementListMyFeed.as_view(), name="api_announcement_feed"),
path("organizations", ApiOrganizationList.as_view(), name="api_organization_list"),
path(
"organization/<int:pk>",
Expand All @@ -28,8 +28,7 @@
path("me/schedule", UserMeSchedule.as_view(), name="api_me_schedule"),
path("me/schedule/week", UserMeScheduleWeek.as_view(), name="api_me_schedule_week"),
path("me/timetable", UserMeTimetable.as_view(), name="api_me_timetable"),
path("events", event, name="api_event_list"),
#path("events", EventsList.as_view(), name="api_event_list"),
path("events", EventsList.as_view(), name="api_event_list"),
path("timetables", TimetableList.as_view(), name="api_timetable_list"),
path(
"timetable/<int:pk>/schedule",
Expand Down
4 changes: 2 additions & 2 deletions core/api/views/announcement.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
],
)
@api_view(["GET"])
def announcement(request, year=None):
def AnnouncementListAll(ListAPIViewWithFallback):
permission_classes = [permissions.AllowAny]
serializer_class = serializers.AnnouncementSerializer

Expand All @@ -52,7 +52,7 @@ def get_queryset(self):
],
)
@api_view(["GET"])
def announcementFeed(request, year=None):
def AnnouncementListMyFeed(ListAPIViewWithFallback):
permission_classes = [permissions.IsAuthenticated | TokenHasScope]
required_scopes = ["me_ann"]
serializer_class = serializers.AnnouncementSerializer
Expand Down
2 changes: 1 addition & 1 deletion core/api/views/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
responses={200: EventSerializer(many=True)},
)
@api_view(["GET"])
def event(request, year=None):
def EventsList(ListAPIViewWithFallback):
permission_classes = [permissions.AllowAny]
parser_classes = [JSONParser]
serializer_class = serializers.EventSerializer
Expand Down

0 comments on commit 22fab55

Please sign in to comment.