From e1485f5d2a141c58112bc3817b1a50ab012ded55 Mon Sep 17 00:00:00 2001 From: devketanpro Date: Wed, 25 Oct 2023 14:23:44 +0530 Subject: [PATCH] Fix(mgmt_api) : add default country canada in companies resource [CPCN-385] --- server/cp/mgmt_api/companies.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/cp/mgmt_api/companies.py b/server/cp/mgmt_api/companies.py index 3242e83..3ffb6f5 100644 --- a/server/cp/mgmt_api/companies.py +++ b/server/cp/mgmt_api/companies.py @@ -13,10 +13,16 @@ def init_app(app): CompaniesResource.internal_resource = False - superdesk.register_resource('companies', CompaniesResource, CPCompaniesService, _app=app) + superdesk.register_resource('companies', CPCompaniesResource, CPCompaniesService, _app=app) superdesk.register_resource('company_products', CompanyProductsResource, CompanyProductsService, _app=app) +class CPCompaniesResource(CompaniesResource): + """ + CP Companies Schema + """ + schema = {**CompaniesResource.schema, "country":{"type": "string", "default" : "CAN"}} + class CPCompaniesService(CompaniesService): def on_create(self, docs): super().on_create(docs)