From b17d6949155dd9e0f504f0bc9cd6dd730f3de27f Mon Sep 17 00:00:00 2001 From: midoks Date: Thu, 14 Jul 2022 09:41:03 +0800 Subject: [PATCH] Update index.py --- plugins/gogs/index.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/plugins/gogs/index.py b/plugins/gogs/index.py index 5c69ddf4c..82f4e18d9 100755 --- a/plugins/gogs/index.py +++ b/plugins/gogs/index.py @@ -616,11 +616,9 @@ def projectScriptLoad(): def projectScriptUnload(): args = getArgs() - if not 'user' in args: - return mw.returnJson(True, 'username missing') - - if not 'name' in args: - return mw.returnJson(True, 'project name missing') + data = checkArgs(args, ['user', 'name']) + if not data[0]: + return data[1] user = args['user'] name = args['name'] + '.git' @@ -637,11 +635,10 @@ def projectScriptUnload(): def projectScriptDebug(): args = getArgs() - if not 'user' in args: - return mw.returnJson(True, 'username missing') + data = checkArgs(args, ['user', 'name']) + if not data[0]: + return data[1] - if not 'name' in args: - return mw.returnJson(True, 'project name missing') user = args['user'] name = args['name'] + '.git' commit_log = getRootPath() + '/' + user + '/' + name + \