Merge pull request #336 from FirmlyReality/login_info

Prevent users that is not activated from applying for beans
This commit is contained in:
Yujian Zhu 2018-09-20 00:19:57 +08:00 committed by GitHub
commit b07eb75a62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import threading, time, traceback
from utils import env from utils import env
from utils.log import logger from utils.log import logger
from httplib2 import Http from httplib2 import Http
from urllib.parse import urlencode
# major dict to store the monitoring data # major dict to store the monitoring data
# only use on Master # only use on Master

View File

@ -519,6 +519,9 @@ def billing_beans():
def beans_apply(cur_user,user,form,issue): def beans_apply(cur_user,user,form,issue):
global G_applicationmgr global G_applicationmgr
if issue == 'apply': 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:'+
'<br/> 1. Complete your information and activate your account. <br/> Or: <br/> 2.Contact administor for further information'})
number = form.get("number",None) number = form.get("number",None)
reason = form.get("reason",None) reason = form.get("reason",None)
if number is None or reason is None: if number is None or reason is None:

View File

@ -121,7 +121,7 @@ def config():
@app.route("/workspace/create/", methods=['GET']) @app.route("/workspace/create/", methods=['GET'])
@activated_required #@activated_required
def addCluster(): def addCluster():
return addClusterView.as_view() return addClusterView.as_view()