valid signup
This commit is contained in:
@@ -374,13 +374,14 @@ def complete_register():
|
||||
except:
|
||||
return jsonify({'status': 'INVALID', 'message': 'Link is invalid'}),403
|
||||
|
||||
country = {
|
||||
"last_update": datetime.datetime.utcnow(),
|
||||
"list": [
|
||||
{"code":"US", "description": "United States" },
|
||||
{"code":"NG", "description": "Nigeria" },
|
||||
]
|
||||
}
|
||||
is_validated = validate.validate_complete_signup_data(data.get('username'), data.get('password'), data.get('country'))
|
||||
if is_validated is not True:
|
||||
return dict(message='Invalid data', data=None, error=is_validated), 400
|
||||
username= data.get('username')
|
||||
password= data.get('password')
|
||||
country= data.get('country')
|
||||
|
||||
|
||||
user_uid = data['user']['uid']
|
||||
#'a4b75649-e3c5-424f-bcdb-5481e625d24b'
|
||||
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] )
|
||||
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):
|
||||
return True
|
||||
|
||||
def validate_complete_signup_data(username,password,country):
|
||||
return True
|
||||
|
||||
def validate_username_and_password(username, password):
|
||||
"""Username and Password Validator"""
|
||||
if not (username and password):
|
||||
|
||||
Reference in New Issue
Block a user