Skip to content

Commit

Permalink
Fix(mgmt_api) : add default country canada in companies resource [CPC…
Browse files Browse the repository at this point in the history
…N-385]
  • Loading branch information
devketanpro committed Oct 25, 2023
1 parent d74cf83 commit e1485f5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server/cp/mgmt_api/companies.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e1485f5

Please sign in to comment.