relation view has been optimised

This commit is contained in:
pycook
2019-12-03 19:10:54 +08:00
parent 8ee7c6daf8
commit 92dd4c5dfe
13 changed files with 241 additions and 83 deletions

View File

@@ -90,7 +90,7 @@ class RoleRelationCRUD(object):
@staticmethod
def delete2(parent_id, child_id):
existed = RoleRelation.get_by(parent_id=parent_id, child_id=child_id)
existed = RoleRelation.get_by(parent_id=parent_id, child_id=child_id, first=True, to_dict=False)
existed or abort(400, "RoleRelation < {0} -> {1} > does not exist".format(parent_id, child_id))
existed.soft_delete()