add new register user in dlt
This commit is contained in:
parent
6a75423532
commit
16ae2c08da
|
@ -33,21 +33,23 @@ class RegisterUserDlt:
|
||||||
email = data.get("email")
|
email = data.get("email")
|
||||||
name = email.split('@')[0]
|
name = email.split('@')[0]
|
||||||
password = data.get("password")
|
password = data.get("password")
|
||||||
|
api_dlt = app.config.get('API_DLT')
|
||||||
eth_priv_key = data.get("eth_priv_key")
|
eth_priv_key = data.get("eth_priv_key")
|
||||||
eth_pub_key = data.get("eth_pub_key")
|
eth_pub_key = data.get("eth_pub_key")
|
||||||
|
|
||||||
user = User.query.filter_by(email=email).first()
|
user = User.query.filter_by(email=email).first()
|
||||||
import pdb; pdb.set_trace()
|
|
||||||
|
|
||||||
if not user:
|
if not user:
|
||||||
user = User(email=email, password=password)
|
user = User(email=email, password=password)
|
||||||
user.individuals.add(Person(name=name))
|
user.individuals.add(Person(name=name))
|
||||||
|
|
||||||
api_dlt = app.config.get('API_DLT')
|
|
||||||
try:
|
try:
|
||||||
response = register_user(api_dlt, eth_priv_key)
|
response = register_user(api_dlt, eth_priv_key)
|
||||||
api_token = response.get('data', {}).get('api_token')
|
api_token = response.get('data', {}).get('api_token')
|
||||||
except Exception:
|
except Exception:
|
||||||
api_token = ""
|
api_token = ""
|
||||||
|
|
||||||
ethereum = {
|
ethereum = {
|
||||||
"eth_pub_key": eth_pub_key,
|
"eth_pub_key": eth_pub_key,
|
||||||
"eth_priv_key": eth_priv_key,
|
"eth_priv_key": eth_priv_key,
|
||||||
|
|
Reference in New Issue