fix jwt decode

This commit is contained in:
pycook
2020-02-06 09:59:24 +08:00
parent 048f556936
commit 87deba2e46
4 changed files with 18 additions and 10 deletions

View File

@@ -40,7 +40,9 @@ class CITypeManager(object):
@staticmethod
def check_is_existed(key):
return CITypeCache.get(key) or abort(404, "CIType <{0}> is not existed".format(key))
ci_type = CITypeCache.get(key) or abort(404, "CIType <{0}> is not existed".format(key))
return CIType.get_by_id(ci_type.id)
@staticmethod
def get_ci_types(type_name=None):
@@ -65,6 +67,9 @@ class CITypeManager(object):
else:
return
if not ci_type:
return
if type_id is not None and ci_type.id != type_id:
return abort(400, "CIType <{0}> is already existed".format(name or alias))