Remove unused django_etebase code.
This commit is contained in:
@@ -18,16 +18,14 @@ from fastapi import APIRouter, Depends, status, Request
|
||||
from fastapi.security import APIKeyHeader
|
||||
|
||||
from django_etebase import app_settings, models
|
||||
from django_etebase.exceptions import EtebaseValidationError
|
||||
from django_etebase.models import UserInfo
|
||||
from django_etebase.signals import user_signed_up
|
||||
from django_etebase.token_auth.models import AuthToken
|
||||
from django_etebase.token_auth.models import get_default_expiry
|
||||
from django_etebase.utils import create_user, get_user_queryset, CallbackContext
|
||||
from django_etebase.views import msgpack_encode, msgpack_decode
|
||||
from .exceptions import AuthenticationFailed, transform_validation_error, HttpError
|
||||
from .msgpack import MsgpackRoute
|
||||
from .utils import BaseModel, permission_responses
|
||||
from .utils import BaseModel, permission_responses, msgpack_encode, msgpack_decode
|
||||
|
||||
User = get_user_model()
|
||||
token_scheme = APIKeyHeader(name="Authorization")
|
||||
@@ -293,7 +291,7 @@ def signup_save(data: SignupIn, request: Request) -> User:
|
||||
context=CallbackContext(request.path_params),
|
||||
)
|
||||
instance.full_clean()
|
||||
except EtebaseValidationError as e:
|
||||
except HttpError as e:
|
||||
raise e
|
||||
except django_exceptions.ValidationError as e:
|
||||
transform_validation_error("user", e)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import dataclasses
|
||||
import typing as t
|
||||
import msgpack
|
||||
|
||||
from fastapi import status, Query, Depends
|
||||
from pydantic import BaseModel as PyBaseModel
|
||||
@@ -44,6 +45,14 @@ def is_collection_admin(collection, user):
|
||||
return (member is not None) and (member.accessLevel == AccessLevels.ADMIN)
|
||||
|
||||
|
||||
def msgpack_encode(content):
|
||||
return msgpack.packb(content, use_bin_type=True)
|
||||
|
||||
|
||||
def msgpack_decode(content):
|
||||
return msgpack.unpackb(content, raw=False)
|
||||
|
||||
|
||||
PERMISSIONS_READ = [Depends(x) for x in app_settings.API_PERMISSIONS_READ]
|
||||
PERMISSIONS_READWRITE = PERMISSIONS_READ + [Depends(x) for x in app_settings.API_PERMISSIONS_WRITE]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user