# HG changeset patch # User Mads Kiilerich # Date 2022-12-27 19:25:59 # Node ID 9fe161e3b5cefd75f3fed2a3913956202b0d6df7 # Parent c6c30609df33ca6ccc4748e2a6f094be06fde975 api docstrings: drop "ERROR OUTPUT" from docstring It is not so valuable, and not included in the user doc. diff --git a/kallithea/controllers/api/api.py b/kallithea/controllers/api/api.py --- a/kallithea/controllers/api/api.py +++ b/kallithea/controllers/api/api.py @@ -161,14 +161,6 @@ class ApiController(JSONRPCController): "repository" : "" } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - "Unable to pull changes from ``" - } """ repo = get_repo_or_error(repoid) @@ -203,14 +195,6 @@ class ApiController(JSONRPCController): 'removed': [,...] } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - 'Error occurred during rescan repositories action' - } """ try: rm_obsolete = remove_obsolete @@ -237,14 +221,6 @@ class ApiController(JSONRPCController): 'repository': } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - 'Error occurred during cache invalidation action' - } """ repo = get_repo_or_error(repoid) if not HasPermissionAny('hg.admin')(): @@ -404,18 +380,6 @@ class ApiController(JSONRPCController): "user" : } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - "user `` already exist" - or - "email `` already exist" - or - "failed to create user ``" - } """ if db.User.get_by_username(username): raise JSONRPCError("user `%s` already exist" % (username,)) @@ -462,14 +426,6 @@ class ApiController(JSONRPCController): "user" : } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - "failed to update user ``" - } """ user = get_user_or_error(userid) @@ -515,14 +471,6 @@ class ApiController(JSONRPCController): "user" : null } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - "failed to delete user ID: " - } """ user = get_user_or_error(userid) @@ -602,16 +550,6 @@ class ApiController(JSONRPCController): "user_group" : } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - "user group `` already exist" - or - "failed to create group ``" - } """ if UserGroupModel().get_by_name(group_name): raise JSONRPCError("user group `%s` already exist" % (group_name,)) @@ -648,14 +586,6 @@ class ApiController(JSONRPCController): "user_group" : } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - "failed to update user group ``" - } """ user_group = get_user_group_or_error(usergroupid) if not HasPermissionAny('hg.admin')(): @@ -696,16 +626,6 @@ class ApiController(JSONRPCController): "msg" : "deleted user group ID: " } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - "failed to delete user group ID: " - or - "RepoGroup assigned to " - } """ user_group = get_user_group_or_error(usergroupid) if not HasPermissionAny('hg.admin')(): @@ -746,14 +666,6 @@ class ApiController(JSONRPCController): User is already in that group" } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - "failed to add member to user group ``" - } """ user = get_user_or_error(userid) user_group = get_user_group_or_error(usergroupid) @@ -1033,14 +945,6 @@ class ApiController(JSONRPCController): "success" : true } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - 'failed to create repository `` - } """ group_name = None repo_name_parts = repo_name.split('/') @@ -1401,14 +1305,6 @@ class ApiController(JSONRPCController): "success" : true } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - "failed to edit permission for user group: `` in repo ``' - } """ repo = get_repo_or_error(repoid) perm = get_perm_or_error(perm) @@ -1546,14 +1442,6 @@ class ApiController(JSONRPCController): "repo_group" : } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - failed to create repo group `` - } """ if db.RepoGroup.get_by_group_name(group_name): raise JSONRPCError("repo group `%s` already exist" % (group_name,)) @@ -1620,14 +1508,6 @@ class ApiController(JSONRPCController): 'repo_group' : null } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - "failed to delete repo group ID: " - } """ repo_group = get_repo_group_or_error(repogroupid) @@ -1662,14 +1542,6 @@ class ApiController(JSONRPCController): "success" : true } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - "failed to edit permission for user: `` in repo group: ``" - } """ repo_group = get_repo_group_or_error(repogroupid) @@ -1715,14 +1587,6 @@ class ApiController(JSONRPCController): "success" : true } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - "failed to edit permission for user: `` in repo group: ``" - } """ repo_group = get_repo_group_or_error(repogroupid) @@ -1769,14 +1633,6 @@ class ApiController(JSONRPCController): "success" : true } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - "failed to edit permission for user group: `` in repo group: ``" - } """ repo_group = get_repo_group_or_error(repogroupid) perm = get_perm_or_error(perm, prefix='group.') @@ -1830,14 +1686,6 @@ class ApiController(JSONRPCController): "success" : true } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - "failed to edit permission for user group: `` in repo group: ``" - } """ repo_group = get_repo_group_or_error(repogroupid) user_group = get_user_group_or_error(usergroupid) @@ -1920,14 +1768,6 @@ class ApiController(JSONRPCController): "gist" : } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - "failed to create gist" - } """ try: if owner is None: @@ -1963,14 +1803,6 @@ class ApiController(JSONRPCController): "gist" : null } error : null - - ERROR OUTPUT:: - - id : - result : null - error : { - "failed to delete gist ID:" - } """ gist = get_gist_or_error(gistid) if not HasPermissionAny('hg.admin')():