fix acl resource

This commit is contained in:
pycook 2019-11-23 17:42:33 +08:00
parent 6c4eefa9c0
commit 77ed1ddb28
1 changed files with 2 additions and 2 deletions

View File

@ -106,7 +106,7 @@ class ResourceGroupCRUD(object):
@staticmethod
def add(name, type_id, app_id):
ResourceGroup.get(name=name, resource_type_id=type_id, app_id=app_id) and abort(
ResourceGroup.get_by(name=name, resource_type_id=type_id, app_id=app_id) and abort(
400, "ResourceGroup <{0}> is already existed".format(name))
return ResourceGroup.create(name=name, resource_type_id=type_id, app_id=app_id)
@ -150,7 +150,7 @@ class ResourceCRUD(object):
@staticmethod
def add(name, type_id, app_id):
Resource.get(name=name, resource_type_id=type_id, app_id=app_id) and abort(
Resource.get_by(name=name, resource_type_id=type_id, app_id=app_id) and abort(
400, "Resource <{0}> is already existed".format(name))
return Resource.create(name=name, resource_type_id=type_id, app_id=app_id)