Fixes and cleanups #11

Merged
profitroll merged 7 commits from dev into master 2023-06-22 14:52:23 +03:00
3 changed files with 33 additions and 14 deletions
Showing only changes of commit b46f3fb0fd - Show all commits

View File

@ -9,7 +9,21 @@ from starlette.status import (
HTTP_422_UNPROCESSABLE_ENTITY,
)
from classes.exceptions import *
from classes.exceptions import (
AlbumNotFoundError,
AlbumAlreadyExistsError,
AlbumIncorrectError,
PhotoNotFoundError,
PhotoSearchQueryEmptyError,
VideoNotFoundError,
VideoSearchQueryEmptyError,
SearchPageInvalidError,
SearchTokenInvalidError,
AccessTokenInvalidError,
UserEmailCodeInvalid,
UserAlreadyExists,
UserCredentialsInvalid,
)
from modules.app import app

View File

@ -1,4 +1,3 @@
import pickle
import re
from datetime import datetime, timedelta, timezone
from os import makedirs, path, remove, system
@ -12,30 +11,37 @@ import aiofiles
from bson.errors import InvalidId
from bson.objectid import ObjectId
from fastapi import Security, UploadFile
from fastapi.exceptions import HTTPException
from fastapi.responses import Response, UJSONResponse
from jose import JWTError, jwt
from magic import Magic
from plum.exceptions import UnpackError
from pydantic import ValidationError
from pymongo import DESCENDING
from starlette.status import (HTTP_204_NO_CONTENT, HTTP_401_UNAUTHORIZED,
HTTP_409_CONFLICT)
from starlette.status import HTTP_204_NO_CONTENT, HTTP_409_CONFLICT
from classes.exceptions import (AccessTokenInvalidError,
AlbumNameNotFoundError, PhotoNotFoundError,
from classes.exceptions import (
AccessTokenInvalidError,
AlbumNameNotFoundError,
PhotoNotFoundError,
PhotoSearchQueryEmptyError,
SearchPageInvalidError,
SearchTokenInvalidError)
SearchTokenInvalidError,
)
from classes.models import Photo, PhotoPublic, SearchResultsPhoto
from modules.app import app
from modules.database import col_albums, col_photos, col_tokens
from modules.exif_reader import extract_location
from modules.hasher import get_duplicates, get_phash
from modules.scheduler import scheduler
from modules.security import (ALGORITHM, SECRET_KEY, TokenData, User,
create_access_token, get_current_active_user,
get_user)
from modules.security import (
ALGORITHM,
SECRET_KEY,
TokenData,
User,
create_access_token,
get_current_active_user,
get_user,
)
from modules.utils import configGet, logWrite

View File

@ -1,4 +1,3 @@
import pickle
import re
from datetime import datetime, timezone
from os import makedirs, path, remove