Compare commits
2 Commits
e1e8ad79b4
...
fc5c63fe87
| Author | SHA1 | Date | |
|---|---|---|---|
| fc5c63fe87 | |||
| ef37d28e1b |
@@ -41,7 +41,7 @@ def get_authed_tenant_registry(registry=Depends(get_tenant_registry), user=Depen
|
|||||||
async def get_uninitialized_registry(instance: str, firm: str, db_client=Depends(get_db_client), user=Depends(get_current_user)) -> Registry:
|
async def get_uninitialized_registry(instance: str, firm: str, db_client=Depends(get_db_client), user=Depends(get_current_user)) -> Registry:
|
||||||
registry = Registry(db_client, instance, firm)
|
registry = Registry(db_client, instance, firm)
|
||||||
if await registry.current_firm is not None:
|
if await registry.current_firm is not None:
|
||||||
HTTPException(status_code=409, detail="Firm configuration already exists")
|
raise HTTPException(status_code=409, detail="Firm configuration already exists")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
registry.set_user(user)
|
registry.set_user(user)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ async def create(schema: CurrentFirmSchemaCreate, reg=Depends(get_uninitialized_
|
|||||||
primary_color=schema.primary_color,
|
primary_color=schema.primary_color,
|
||||||
secondary_color=schema.secondary_color,
|
secondary_color=schema.secondary_color,
|
||||||
))
|
))
|
||||||
return CurrentFirmSchemaRead.from_model(document)
|
return CurrentFirmSchemaRead.from_model_and_entities(document, EntityRead.from_model(corp), EntityRead.from_model(owner_entity))
|
||||||
|
|
||||||
@current_firm_router.put("/", response_description=f"Current Firm record updated")
|
@current_firm_router.put("/", response_description=f"Current Firm record updated")
|
||||||
async def update(schema: CurrentFirmSchemaUpdate, reg=Depends(get_authed_tenant_registry)) -> CurrentFirmSchemaRead:
|
async def update(schema: CurrentFirmSchemaUpdate, reg=Depends(get_authed_tenant_registry)) -> CurrentFirmSchemaRead:
|
||||||
|
|||||||
Reference in New Issue
Block a user