コード例 #1
0
ファイル: catalog.py プロジェクト: toby82/murano
 def delete_category(self, req, category_id):
     target = {'category_id': category_id}
     policy.check("delete_category", req.context, target)
     category = db_api.category_get(category_id, packages=True)
     if category.packages:
         msg = _("It's impossible to delete categories assigned "
                 "to the package, uploaded to the catalog")
         raise exc.HTTPForbidden(explanation=msg)
     db_api.category_delete(category_id)
コード例 #2
0
ファイル: catalog.py プロジェクト: swevm/murano
 def delete_category(self, req, category_id):
     target = {'category_id': category_id}
     policy.check("delete_category", req.context, target)
     category = db_api.category_get(category_id, packages=True)
     if category.packages:
         msg = _("It's impossible to delete categories assigned"
                 " to the package, uploaded to the catalog")
         raise exc.HTTPForbidden(explanation=msg)
     db_api.category_delete(category_id)
コード例 #3
0
ファイル: catalog.py プロジェクト: toby82/murano
 def get_category(self, req, category_id):
     policy.check("get_category", req.context)
     category = db_api.category_get(category_id, packages=True)
     return category.to_dict()
コード例 #4
0
ファイル: catalog.py プロジェクト: swevm/murano
 def get_category(self, req, category_id):
     policy.check("get_category", req.context)
     category = db_api.category_get(category_id, packages=True)
     return category.to_dict()