Server backup 2026-11-07 of uncommitted work in projects/pharma-web-celtic
Snapshot of the working tree on srv1071960 (branch main), taken during server cleanup. .env files, node_modules, builds, logs and media were excluded.
This commit is contained in:
@@ -60,7 +60,7 @@ class OrganizationService:
|
||||
return list((await self.db.execute(stmt)).scalars().all())
|
||||
|
||||
async def list_area_manager_mappings(self, actor: User) -> list[AMHeadquarters]:
|
||||
"""Current (open) Area Manager to headquarters mappings, for display."""
|
||||
"""Current (open) Area Business Manager to headquarters mappings, for display."""
|
||||
stmt = (
|
||||
select(AMHeadquarters)
|
||||
.join(Headquarters, Headquarters.id == AMHeadquarters.headquarters_id)
|
||||
@@ -79,7 +79,7 @@ class OrganizationService:
|
||||
actor: User,
|
||||
ip: str | None = None,
|
||||
) -> list[AMHeadquarters]:
|
||||
"""Make `headquarters_ids` exactly the set of headquarters this AM manages.
|
||||
"""Make `headquarters_ids` exactly the set of headquarters this ABM manages.
|
||||
|
||||
Headquarters missing from the list are released, new ones are added. Other Area
|
||||
Managers of the same headquarters keep it: a headquarters may have several.
|
||||
@@ -87,9 +87,9 @@ class OrganizationService:
|
||||
manager = await self.db.get(User, am_user_id)
|
||||
if manager is None or manager.company_id != actor.company_id:
|
||||
raise NotFoundError("User not found")
|
||||
if manager.role != Role.AM:
|
||||
if manager.role != Role.ABM:
|
||||
raise ValidationError(
|
||||
"Only a user with the AM role can manage a headquarters",
|
||||
"Only an ABM can manage a headquarters",
|
||||
{"user_role": manager.role.value},
|
||||
)
|
||||
|
||||
@@ -165,7 +165,7 @@ class OrganizationService:
|
||||
actor: User,
|
||||
ip: str | None = None,
|
||||
) -> AMHeadquarters:
|
||||
"""Add an Area Manager to a headquarters, beside any it already has.
|
||||
"""Add an Area Business Manager to a headquarters, beside any it already has.
|
||||
|
||||
Assigning the same pair twice changes nothing (`uq_active_am_hq_pair`).
|
||||
"""
|
||||
@@ -176,9 +176,9 @@ class OrganizationService:
|
||||
manager = await self.db.get(User, am_user_id)
|
||||
if manager is None:
|
||||
raise NotFoundError("User not found")
|
||||
if manager.role != Role.AM:
|
||||
if manager.role != Role.ABM:
|
||||
raise ValidationError(
|
||||
"Only a user with the AM role can manage a headquarters",
|
||||
"Only an ABM can manage a headquarters",
|
||||
{"user_role": manager.role.value},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user