feat(backend): refactor/fix group management for admins (#838)

* fix(frontend): 🐛 update dialog implementation to simplify state management

* test(backend):  refactor test fixtures + admin group tests

* chore(backend): 🔨 add launcher.json for python debugging (tests)

* fix typing

* feat(backend):  refactor/fix group management for admins

* feat(frontend):  add/fix admin group management

* add LDAP checker

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden
2021-11-25 14:17:02 -09:00
committed by GitHub
parent 0db8a58963
commit 791aa8c610
52 changed files with 881 additions and 331 deletions

View File

@@ -27,4 +27,5 @@ class AdminAboutInfo(AppInfo):
class CheckAppConfig(CamelModel):
email_ready: bool = False
ldap_ready: bool = False
base_url_set: bool = False

View File

@@ -0,0 +1,9 @@
from fastapi_camelcase import CamelModel
from .group_preferences import UpdateGroupPreferences
class GroupAdminUpdate(CamelModel):
id: int
name: str
preferences: UpdateGroupPreferences

18
mealie/schema/mapper.py Normal file
View File

@@ -0,0 +1,18 @@
from typing import Generic, TypeVar
from pydantic import BaseModel
T = TypeVar("T", bound=BaseModel)
U = TypeVar("U", bound=BaseModel)
def mapper(source: U, dest: T, **kwargs) -> Generic[T]:
"""
Map a source model to a destination model. Only top-level fields are mapped.
"""
for field in source.__fields__:
if field in dest.__fields__:
setattr(dest, field, getattr(source, field))
return dest