From 0197ddb4d1d6317ec8d40f06545178af1440f3f2 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 24 Jan 2024 14:47:42 +0100 Subject: [PATCH] fix new dict of dlt_secrets --- ereuse_devicehub/commands/snapshot_files/.c | 0 ereuse_devicehub/forms.py | 2 +- .../modules/dpp/commands/register_user_dlt.py | 8 ++++---- 3 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 ereuse_devicehub/commands/snapshot_files/.c diff --git a/ereuse_devicehub/commands/snapshot_files/.c b/ereuse_devicehub/commands/snapshot_files/.c deleted file mode 100644 index e69de29b..00000000 diff --git a/ereuse_devicehub/forms.py b/ereuse_devicehub/forms.py index f8b62d3f..d9a1a577 100644 --- a/ereuse_devicehub/forms.py +++ b/ereuse_devicehub/forms.py @@ -70,7 +70,7 @@ class LoginForm(FlaskForm): self.form_errors.append(self.error_messages['inactive']) if 'dpp' in app.blueprints.keys(): - dlt_keys = user.get_dlt_keys(self.password.data).get('data', {}) + dlt_keys = user.get_dlt_keys(self.password.data) token_dlt = dlt_keys.get('api_token') eth_pub_key = dlt_keys.get('eth_pub_key') session['token_dlt'] = token_dlt diff --git a/ereuse_devicehub/modules/dpp/commands/register_user_dlt.py b/ereuse_devicehub/modules/dpp/commands/register_user_dlt.py index 2b334cf1..75c33532 100644 --- a/ereuse_devicehub/modules/dpp/commands/register_user_dlt.py +++ b/ereuse_devicehub/modules/dpp/commands/register_user_dlt.py @@ -43,9 +43,9 @@ class RegisterUserDlt: user = User(email=email, password=password) user.individuals.add(Person(name=name)) - + # import pdb; pdb.set_trace() try: - response = register_user(api_dlt, eth_priv_key) + response = register_user(api_dlt, privateKey=eth_priv_key[2:]) api_token = response.get('data', {}).get('api_token') except Exception: api_token = "" @@ -70,5 +70,5 @@ class RegisterUserDlt: user.rols_dlt = json.dumps(roles) - if not user.id: - db.session.add(user) + # if not user.id: + db.session.add(user)