Separate client service subscriptions from engagement instances
This commit is contained in:
@@ -10,6 +10,7 @@ from app.core.templating import templates
|
||||
from app.modules.services.models import ClientServiceSubscription
|
||||
from app.modules.services.client_services import (
|
||||
SUBSCRIPTION_STATUSES,
|
||||
attach_engagement_to_plan,
|
||||
get_enabled_firm_service,
|
||||
get_existing_subscription,
|
||||
get_subscription,
|
||||
@@ -216,6 +217,12 @@ def subscription_create_submit(
|
||||
row.remarks = remarks.strip() or None
|
||||
row.is_active = is_active is not None
|
||||
row.updated_by_user_id = user.id
|
||||
client = db.get(__import__("app.modules.clients.models", fromlist=["Client"]).Client, client_id)
|
||||
if client is not None:
|
||||
attach_engagement_to_plan(
|
||||
db, engagement=row, client=client, catalogue=firm_selection.catalogue,
|
||||
firm_selection=firm_selection, actor_user_id=user.id,
|
||||
)
|
||||
|
||||
db.commit()
|
||||
db.refresh(row)
|
||||
|
||||
Reference in New Issue
Block a user