valid signup
This commit is contained in:
@@ -374,13 +374,14 @@ def complete_register():
|
|||||||
except:
|
except:
|
||||||
return jsonify({'status': 'INVALID', 'message': 'Link is invalid'}),403
|
return jsonify({'status': 'INVALID', 'message': 'Link is invalid'}),403
|
||||||
|
|
||||||
country = {
|
is_validated = validate.validate_complete_signup_data(data.get('username'), data.get('password'), data.get('country'))
|
||||||
"last_update": datetime.datetime.utcnow(),
|
if is_validated is not True:
|
||||||
"list": [
|
return dict(message='Invalid data', data=None, error=is_validated), 400
|
||||||
{"code":"US", "description": "United States" },
|
username= data.get('username')
|
||||||
{"code":"NG", "description": "Nigeria" },
|
password= data.get('password')
|
||||||
]
|
country= data.get('country')
|
||||||
}
|
|
||||||
|
|
||||||
user_uid = data['user']['uid']
|
user_uid = data['user']['uid']
|
||||||
#'a4b75649-e3c5-424f-bcdb-5481e625d24b'
|
#'a4b75649-e3c5-424f-bcdb-5481e625d24b'
|
||||||
FIND_USER_DETAIL= "SELECT firstname,lastname,email, uid FROM members_pending WHERE uid::text = '"+user_uid+"'"
|
FIND_USER_DETAIL= "SELECT firstname,lastname,email, uid FROM members_pending WHERE uid::text = '"+user_uid+"'"
|
||||||
@@ -393,7 +394,7 @@ def complete_register():
|
|||||||
accountRes = json.dumps( [dict(ix) for ix in account] )
|
accountRes = json.dumps( [dict(ix) for ix in account] )
|
||||||
user_array = json.loads(accountRes)
|
user_array = json.loads(accountRes)
|
||||||
|
|
||||||
return jsonify(status="VALID", user=user_array[0], pending_uid=user_uid,country=country)
|
return jsonify(status="VALID", user=user_array[0], pending_uid=user_uid)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ def validate_username(username: str):
|
|||||||
def validate_signup_data(firstname,lastname,email):
|
def validate_signup_data(firstname,lastname,email):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def validate_complete_signup_data(username,password,country):
|
||||||
|
return True
|
||||||
|
|
||||||
def validate_username_and_password(username, password):
|
def validate_username_and_password(username, password):
|
||||||
"""Username and Password Validator"""
|
"""Username and Password Validator"""
|
||||||
if not (username and password):
|
if not (username and password):
|
||||||
|
|||||||
Reference in New Issue
Block a user