kopia lustrzana https://gitlab.com/marnanel/chapeau
Stubs for notification and filters API.
rodzic
7000946dd2
commit
fc26ddd039
|
@ -7,6 +7,8 @@ urlpatterns = [
|
|||
path('api/v1/apps', Apps.as_view()),
|
||||
path('api/v1/accounts/verify_credentials', Verify_Credentials.as_view()),
|
||||
path('api/v1/statuses', Statuses.as_view()),
|
||||
path('api/v1/notifications', Notifications.as_view()),
|
||||
path('api/v1/filters', Filters.as_view()),
|
||||
path('api/v1/timelines/public', PublicTimeline.as_view()),
|
||||
path('api/v1/timelines/home', HomeTimeline.as_view()),
|
||||
|
||||
|
|
|
@ -126,16 +126,20 @@ class PublicTimeline(AbstractTimeline):
|
|||
permission_classes = ()
|
||||
|
||||
def get_queryset(self, request):
|
||||
return AcItem.objects.filter(visibility=Visibility('public').name)
|
||||
return AcItem.objects.filter(visibility='public')
|
||||
|
||||
class HomeTimeline(AbstractTimeline):
|
||||
|
||||
permission_classes = ()
|
||||
|
||||
def get_queryset(self, request):
|
||||
return kepi_models.Collection.get(
|
||||
user = request.user.actor,
|
||||
collection = 'inbox').members
|
||||
|
||||
if request.user.is_anonymous:
|
||||
return AcItem.objects.filter(visibility='public')
|
||||
else:
|
||||
return kepi_models.Collection.get(
|
||||
user = request.user.actor,
|
||||
collection = 'inbox').members
|
||||
|
||||
########################################
|
||||
|
||||
|
@ -326,3 +330,14 @@ class FeaturedCollectionView(View):
|
|||
def get_collection_items(self, *args, **kwargs):
|
||||
return Status.objects.none()
|
||||
|
||||
class Notifications(View):
|
||||
# FIXME
|
||||
def get(self, request, *args, **kwargs):
|
||||
return JsonResponse([],
|
||||
safe=False)
|
||||
|
||||
class Filters(View):
|
||||
# FIXME
|
||||
def get(self, request, *args, **kwargs):
|
||||
return JsonResponse([],
|
||||
safe=False)
|
||||
|
|
Ładowanie…
Reference in New Issue