From 7497e58bdcbe2e6f2b850c61eda3eccecdc7a8c4 Mon Sep 17 00:00:00 2001 From: zhuyj17 Date: Wed, 19 Sep 2018 22:57:16 +0800 Subject: [PATCH 1/2] Fix a bug of not import urlencode --- src/master/monitor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/master/monitor.py b/src/master/monitor.py index c124ffc..219d2d4 100644 --- a/src/master/monitor.py +++ b/src/master/monitor.py @@ -2,6 +2,7 @@ import threading, time, traceback from utils import env from utils.log import logger from httplib2 import Http +from urllib.parse import urlencode # major dict to store the monitoring data # only use on Master From 4ddab4fa4b9d8986228ad296b603535ad97c34ed Mon Sep 17 00:00:00 2001 From: zhuyj17 Date: Thu, 20 Sep 2018 00:16:53 +0800 Subject: [PATCH 2/2] Check if user is activated before applying for beans --- user/user.py | 3 +++ web/web.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/user/user.py b/user/user.py index 14e83d0..7d5ed6b 100755 --- a/user/user.py +++ b/user/user.py @@ -519,6 +519,9 @@ def billing_beans(): def beans_apply(cur_user,user,form,issue): global G_applicationmgr if issue == 'apply': + if not cur_user.status == 'normal': + return json.dumps({'success':'false', 'message':'Fail to apply for beans because your account is locked/not activated. Please:'+ + '
1. Complete your information and activate your account.
Or:
2.Contact administor for further information'}) number = form.get("number",None) reason = form.get("reason",None) if number is None or reason is None: diff --git a/web/web.py b/web/web.py index 0d195fe..db5bf77 100755 --- a/web/web.py +++ b/web/web.py @@ -121,7 +121,7 @@ def config(): @app.route("/workspace/create/", methods=['GET']) -@activated_required +#@activated_required def addCluster(): return addClusterView.as_view()