mirror of
https://github.com/bellingcat/auto-archiver-api.git
synced 2026-06-08 03:28:35 +03:00
moving user_state out of shared
This commit is contained in:
@@ -3,7 +3,7 @@ from fastapi.testclient import TestClient
|
||||
import pytest
|
||||
from unittest.mock import patch
|
||||
from app.shared.config import ALLOW_ANY_EMAIL
|
||||
from app.shared.db.user_state import UserState
|
||||
from app.web.db.user_state import UserState
|
||||
from app.shared.settings import Settings
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ def test_create_sheet_endpoint(app_with_auth, db_session):
|
||||
|
||||
# switch to jerry who's got less quota/permissions
|
||||
from web.security import get_user_state
|
||||
from app.shared.db.user_state import UserState
|
||||
from app.web.db.user_state import UserState
|
||||
app_with_auth.dependency_overrides[get_user_state] = lambda: UserState(db_session, "jerry@example.com")
|
||||
client_jerry = TestClient(app_with_auth)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ from app.shared.config import VERSION, BREAKING_CHANGES
|
||||
from app.shared.log import log_error
|
||||
from app.shared.db import crud
|
||||
from app.shared.schemas import ActiveUser, UsageResponse
|
||||
from app.shared.db.user_state import UserState
|
||||
from app.web.db.user_state import UserState
|
||||
from app.web.security import get_user_auth, bearer_security, get_user_state
|
||||
from app.shared.user_groups import GroupInfo
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ from fastapi.responses import JSONResponse
|
||||
from sqlalchemy import exc
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.shared.db.user_state import UserState
|
||||
from app.web.db.user_state import UserState
|
||||
from app.shared import schemas
|
||||
from app.shared.task_messaging import get_celery
|
||||
from app.web.security import get_user_state
|
||||
|
||||
@@ -10,7 +10,7 @@ from app.shared import schemas
|
||||
from app.shared.task_messaging import get_celery
|
||||
from app.web.security import get_token_or_user_auth, get_user_state
|
||||
from app.shared.db import crud
|
||||
from app.shared.db.user_state import UserState
|
||||
from app.web.db.user_state import UserState
|
||||
from app.shared.db.database import get_db_dependency
|
||||
|
||||
from urllib.parse import urlparse
|
||||
|
||||
@@ -6,7 +6,7 @@ from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
|
||||
from app.shared.config import ALLOW_ANY_EMAIL
|
||||
from app.shared.settings import get_settings
|
||||
from app.shared.db.database import get_db
|
||||
from app.shared.db.user_state import UserState
|
||||
from app.web.db.user_state import UserState
|
||||
|
||||
settings = get_settings()
|
||||
bearer_security = HTTPBearer()
|
||||
|
||||
Reference in New Issue
Block a user