From 91738748ecf6aa0a2e8cbb857f220f7f3c58ac11 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Mon, 13 Feb 2023 21:17:26 -0700 Subject: [PATCH] Fix some imports now hatchway is third party --- api/pagination.py | 2 +- api/views/announcements.py | 2 +- api/views/emoji.py | 3 ++- api/views/filters.py | 3 ++- api/views/instance.py | 2 +- api/views/notifications.py | 2 +- api/views/search.py | 3 ++- api/views/timelines.py | 2 +- api/views/trends.py | 2 +- 9 files changed, 12 insertions(+), 9 deletions(-) diff --git a/api/pagination.py b/api/pagination.py index 8645e77..2139e09 100644 --- a/api/pagination.py +++ b/api/pagination.py @@ -5,9 +5,9 @@ from typing import Any, Generic, Protocol, TypeVar from django.db import models from django.http import HttpRequest +from hatchway.http import ApiResponse from activities.models import PostInteraction -from hatchway.http import ApiResponse T = TypeVar("T") diff --git a/api/views/announcements.py b/api/views/announcements.py index 50fe473..90e3f42 100644 --- a/api/views/announcements.py +++ b/api/views/announcements.py @@ -1,8 +1,8 @@ from django.shortcuts import get_object_or_404 +from hatchway import api_view from api import schemas from api.decorators import identity_required -from hatchway import api_view from users.models import Announcement from users.services import AnnouncementService diff --git a/api/views/emoji.py b/api/views/emoji.py index f909067..a0fdad5 100644 --- a/api/views/emoji.py +++ b/api/views/emoji.py @@ -1,6 +1,7 @@ +from hatchway import api_view + from activities.models import Emoji from api.schemas import CustomEmoji -from hatchway import api_view @api_view.get diff --git a/api/views/filters.py b/api/views/filters.py index 5b94f41..447a1c6 100644 --- a/api/views/filters.py +++ b/api/views/filters.py @@ -1,6 +1,7 @@ -from api.decorators import identity_required from hatchway import api_view +from api.decorators import identity_required + @identity_required @api_view.get diff --git a/api/views/instance.py b/api/views/instance.py index 1419038..b5be187 100644 --- a/api/views/instance.py +++ b/api/views/instance.py @@ -1,9 +1,9 @@ from django.conf import settings +from hatchway import api_view from activities.models import Post from api import schemas from core.models import Config -from hatchway import api_view from takahe import __version__ from users.models import Domain, Identity diff --git a/api/views/notifications.py b/api/views/notifications.py index 5553d6a..fad897e 100644 --- a/api/views/notifications.py +++ b/api/views/notifications.py @@ -1,11 +1,11 @@ from django.http import HttpRequest +from hatchway import ApiResponse, api_view from activities.models import TimelineEvent from activities.services import TimelineService from api import schemas from api.decorators import identity_required from api.pagination import MastodonPaginator, PaginatingApiResponse, PaginationResult -from hatchway import ApiResponse, api_view @identity_required diff --git a/api/views/search.py b/api/views/search.py index bca127d..a3a675a 100644 --- a/api/views/search.py +++ b/api/views/search.py @@ -1,10 +1,11 @@ from typing import Literal +from hatchway import Field, api_view + from activities.models import PostInteraction from activities.services.search import SearchService from api import schemas from api.decorators import identity_required -from hatchway import Field, api_view @identity_required diff --git a/api/views/timelines.py b/api/views/timelines.py index fcaf6bc..1a1a5db 100644 --- a/api/views/timelines.py +++ b/api/views/timelines.py @@ -1,4 +1,5 @@ from django.http import HttpRequest +from hatchway import ApiError, ApiResponse, api_view from activities.models import Post from activities.services import TimelineService @@ -6,7 +7,6 @@ from api import schemas from api.decorators import identity_required from api.pagination import MastodonPaginator, PaginatingApiResponse, PaginationResult from core.models import Config -from hatchway import ApiError, ApiResponse, api_view @identity_required diff --git a/api/views/trends.py b/api/views/trends.py index 35b79fd..6d03168 100644 --- a/api/views/trends.py +++ b/api/views/trends.py @@ -1,8 +1,8 @@ from django.http import HttpRequest +from hatchway import api_view from api import schemas from api.decorators import identity_required -from hatchway import api_view @identity_required