From 098e79ea0559452e7426f79fb4a05a9cff54dd3c Mon Sep 17 00:00:00 2001 From: Artem Los Date: Tue, 24 Jan 2023 16:08:30 +0100 Subject: [PATCH] Fix machine code method + from_string --- licensing/internal.py | 2 +- licensing/models.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/licensing/internal.py b/licensing/internal.py index 52bccbc..caf3c8a 100644 --- a/licensing/internal.py +++ b/licensing/internal.py @@ -159,7 +159,7 @@ def start_process_ps_v2(): cmd = ["powershell", *ps_args.split(" ")] - proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) out, err = proc.communicate(timeout=120) rawOutput = out.decode('utf-8').strip() diff --git a/licensing/models.py b/licensing/models.py index 1a3ea8d..8b24af8 100644 --- a/licensing/models.py +++ b/licensing/models.py @@ -167,15 +167,15 @@ def __init__(self, license_key, signature, result, message): @staticmethod def from_string(responseString): - obj = json.loads(responseString) + obj = dict((k.lower(),v) for k,v in json.loads(responseString).items()) licenseKey = "" signature = "" result = 0 message = "" - if "licenseKey" in obj: - licenseKey = obj["licenseKey"] + if "licensekey" in obj: + licenseKey = obj["licensekey"] if "signature" in obj: signature = obj["signature"]