fix: move myauth module from toplevel to under etebase_server

This is in preparation for creating a python package, which should only
occupy the "etebase_server" name in the global module namespace.
master
Xiretza 3 years ago
parent 163f7766f1
commit 9d6e0ae60a

@ -1,7 +1,7 @@
from django.db import models from django.db import models
from django.utils import timezone from django.utils import timezone
from django.utils.crypto import get_random_string from django.utils.crypto import get_random_string
from myauth.models import get_typed_user_model from etebase_server.myauth.models import get_typed_user_model
User = get_typed_user_model() User = get_typed_user_model()

@ -3,7 +3,7 @@ from dataclasses import dataclass
from django.db.models import QuerySet from django.db.models import QuerySet
from django.core.exceptions import PermissionDenied from django.core.exceptions import PermissionDenied
from myauth.models import UserType, get_typed_user_model from etebase_server.myauth.models import UserType, get_typed_user_model
from . import app_settings from . import app_settings

@ -8,7 +8,7 @@ from django.db.models import QuerySet
from django_etebase import models from django_etebase import models
from django_etebase.token_auth.models import AuthToken, get_default_expiry from django_etebase.token_auth.models import AuthToken, get_default_expiry
from myauth.models import UserType, get_typed_user_model from etebase_server.myauth.models import UserType, get_typed_user_model
from .exceptions import AuthenticationFailed from .exceptions import AuthenticationFailed
from .utils import get_object_or_404 from .utils import get_object_or_404
from .db_hack import django_db_cleanup_decorator from .db_hack import django_db_cleanup_decorator

@ -19,7 +19,7 @@ from django_etebase.token_auth.models import AuthToken
from django_etebase.models import UserInfo from django_etebase.models import UserInfo
from django_etebase.signals import user_signed_up from django_etebase.signals import user_signed_up
from django_etebase.utils import create_user, get_user_queryset, CallbackContext from django_etebase.utils import create_user, get_user_queryset, CallbackContext
from myauth.models import UserType, get_typed_user_model from etebase_server.myauth.models import UserType, get_typed_user_model
from ..exceptions import AuthenticationFailed, transform_validation_error, HttpError from ..exceptions import AuthenticationFailed, transform_validation_error, HttpError
from ..msgpack import MsgpackRoute from ..msgpack import MsgpackRoute
from ..utils import BaseModel, permission_responses, msgpack_encode, msgpack_decode, get_user_username_email_kwargs from ..utils import BaseModel, permission_responses, msgpack_encode, msgpack_decode, get_user_username_email_kwargs

@ -8,7 +8,7 @@ from django.db.models import Q, QuerySet
from fastapi import APIRouter, Depends, status, Request, BackgroundTasks from fastapi import APIRouter, Depends, status, Request, BackgroundTasks
from django_etebase import models from django_etebase import models
from myauth.models import UserType from etebase_server.myauth.models import UserType
from .authentication import get_authenticated_user from .authentication import get_authenticated_user
from .websocket import get_ticket, TicketRequest, TicketOut from .websocket import get_ticket, TicketRequest, TicketOut
from ..exceptions import HttpError, transform_validation_error, PermissionDenied, ValidationError from ..exceptions import HttpError, transform_validation_error, PermissionDenied, ValidationError

@ -6,7 +6,7 @@ from fastapi import APIRouter, Depends, status, Request
from django_etebase import models from django_etebase import models
from django_etebase.utils import get_user_queryset, CallbackContext from django_etebase.utils import get_user_queryset, CallbackContext
from myauth.models import UserType, get_typed_user_model from etebase_server.myauth.models import UserType, get_typed_user_model
from .authentication import get_authenticated_user from .authentication import get_authenticated_user
from ..exceptions import HttpError, PermissionDenied from ..exceptions import HttpError, PermissionDenied
from ..msgpack import MsgpackRoute from ..msgpack import MsgpackRoute

@ -5,7 +5,7 @@ from django.db.models import QuerySet
from fastapi import APIRouter, Depends, status from fastapi import APIRouter, Depends, status
from django_etebase import models from django_etebase import models
from myauth.models import UserType, get_typed_user_model from etebase_server.myauth.models import UserType, get_typed_user_model
from .authentication import get_authenticated_user from .authentication import get_authenticated_user
from ..msgpack import MsgpackRoute from ..msgpack import MsgpackRoute
from ..utils import get_object_or_404, BaseModel, permission_responses, PERMISSIONS_READ, PERMISSIONS_READWRITE from ..utils import get_object_or_404, BaseModel, permission_responses, PERMISSIONS_READ, PERMISSIONS_READWRITE

@ -7,7 +7,7 @@ from django_etebase.utils import get_user_queryset, CallbackContext
from .authentication import SignupIn, signup_save from .authentication import SignupIn, signup_save
from ..msgpack import MsgpackRoute from ..msgpack import MsgpackRoute
from ..exceptions import HttpError from ..exceptions import HttpError
from myauth.models import get_typed_user_model from etebase_server.myauth.models import get_typed_user_model
test_reset_view_router = APIRouter(route_class=MsgpackRoute, tags=["test helpers"]) test_reset_view_router = APIRouter(route_class=MsgpackRoute, tags=["test helpers"])
User = get_typed_user_model() User = get_typed_user_model()

@ -10,7 +10,7 @@ import nacl.utils
from django_etebase import models from django_etebase import models
from django_etebase.utils import CallbackContext, get_user_queryset from django_etebase.utils import CallbackContext, get_user_queryset
from myauth.models import UserType, get_typed_user_model from etebase_server.myauth.models import UserType, get_typed_user_model
from ..dependencies import get_collection_queryset, get_item_queryset from ..dependencies import get_collection_queryset, get_item_queryset
from ..exceptions import NotSupported from ..exceptions import NotSupported

@ -12,7 +12,7 @@ from django.core.exceptions import ObjectDoesNotExist
from django_etebase import app_settings from django_etebase import app_settings
from django_etebase.models import AccessLevels from django_etebase.models import AccessLevels
from myauth.models import UserType, get_typed_user_model from etebase_server.myauth.models import UserType, get_typed_user_model
from .exceptions import HttpError, HttpErrorOut from .exceptions import HttpError, HttpErrorOut

@ -2,4 +2,5 @@ from django.apps import AppConfig
class MyauthConfig(AppConfig): class MyauthConfig(AppConfig):
name = "myauth" name = "etebase_server.myauth"
label = "myauth"

@ -1,6 +1,6 @@
from django import forms from django import forms
from django.contrib.auth.forms import UsernameField from django.contrib.auth.forms import UsernameField
from myauth.models import get_typed_user_model from etebase_server.myauth.models import get_typed_user_model
User = get_typed_user_model() User = get_typed_user_model()

@ -1,7 +1,7 @@
# Generated by Django 3.0.3 on 2020-05-15 08:01 # Generated by Django 3.0.3 on 2020-05-15 08:01
from django.db import migrations, models from django.db import migrations, models
import myauth.models import etebase_server.myauth.models as myauth_models
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -19,7 +19,7 @@ class Migration(migrations.Migration):
help_text="Required. 150 characters or fewer. Letters, digits and ./+/-/_ only.", help_text="Required. 150 characters or fewer. Letters, digits and ./+/-/_ only.",
max_length=150, max_length=150,
unique=True, unique=True,
validators=[myauth.models.UnicodeUsernameValidator()], validators=[myauth_models.UnicodeUsernameValidator()],
verbose_name="username", verbose_name="username",
), ),
), ),

@ -1,7 +1,7 @@
# Generated by Django 3.1.1 on 2020-11-19 08:10 # Generated by Django 3.1.1 on 2020-11-19 08:10
from django.db import migrations, models from django.db import migrations, models
import myauth.models import etebase_server.myauth.models as myauth_models
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -14,7 +14,7 @@ class Migration(migrations.Migration):
migrations.AlterModelManagers( migrations.AlterModelManagers(
name="user", name="user",
managers=[ managers=[
("objects", myauth.models.UserManager()), ("objects", myauth_models.UserManager()),
], ],
), ),
migrations.AlterField( migrations.AlterField(
@ -30,7 +30,7 @@ class Migration(migrations.Migration):
help_text="Required. 150 characters or fewer. Letters, digits and ./-/_ only.", help_text="Required. 150 characters or fewer. Letters, digits and ./-/_ only.",
max_length=150, max_length=150,
unique=True, unique=True,
validators=[myauth.models.UnicodeUsernameValidator()], validators=[myauth_models.UnicodeUsernameValidator()],
verbose_name="username", verbose_name="username",
), ),
), ),

@ -54,7 +54,7 @@ INSTALLED_APPS = [
"django.contrib.sessions", "django.contrib.sessions",
"django.contrib.messages", "django.contrib.messages",
"django.contrib.staticfiles", "django.contrib.staticfiles",
"myauth.apps.MyauthConfig", "etebase_server.myauth.apps.MyauthConfig",
"django_etebase.apps.DjangoEtebaseConfig", "django_etebase.apps.DjangoEtebaseConfig",
"django_etebase.token_auth.apps.TokenAuthConfig", "django_etebase.token_auth.apps.TokenAuthConfig",
] ]

Loading…
Cancel
Save