From 16ae2c08da008d8de20ea74aa195bc89a7cb08d1 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 23 Jan 2024 18:10:00 +0100 Subject: [PATCH] add new register user in dlt --- ereuse_devicehub/modules/dpp/commands/register_user_dlt.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/modules/dpp/commands/register_user_dlt.py b/ereuse_devicehub/modules/dpp/commands/register_user_dlt.py index 8ffe1d4c..e67c7d73 100644 --- a/ereuse_devicehub/modules/dpp/commands/register_user_dlt.py +++ b/ereuse_devicehub/modules/dpp/commands/register_user_dlt.py @@ -33,21 +33,23 @@ class RegisterUserDlt: email = data.get("email") name = email.split('@')[0] password = data.get("password") + api_dlt = app.config.get('API_DLT') eth_priv_key = data.get("eth_priv_key") eth_pub_key = data.get("eth_pub_key") + user = User.query.filter_by(email=email).first() - import pdb; pdb.set_trace() if not user: user = User(email=email, password=password) user.individuals.add(Person(name=name)) - api_dlt = app.config.get('API_DLT') + try: response = register_user(api_dlt, eth_priv_key) api_token = response.get('data', {}).get('api_token') except Exception: api_token = "" + ethereum = { "eth_pub_key": eth_pub_key, "eth_priv_key": eth_priv_key,