Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #7 from Sainomori/LITE-29386-fix-ms-cooper-lost-do…
Browse files Browse the repository at this point in the history
…main

LITE-29386 Extend condition in param retrieval to include name comparison
  • Loading branch information
slastique authored Jan 25, 2024
2 parents 771d412 + b44a7e3 commit b77c429
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
5 changes: 4 additions & 1 deletion reports/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def convert_to_datetime(param_value):
def convert_to_datetime_subscription(param_value):
return datetime.fromisoformat(param_value).strftime("%Y-%m-%d %H:%M:%S")


def get_basic_value(base, value):
if base and value in base:
return base[value]
Expand Down Expand Up @@ -55,9 +56,10 @@ def get_parameter(request, param_id):
return param["value"]
return "-"


def get_sub_parameter(subscription, param_id):
for param in subscription["params"]:
if param["id"] == param_id:
if param["id"] == param_id or param["name"] == param_id:
return param.get('value', '-')
return "-"

Expand All @@ -84,6 +86,7 @@ def get_ta_parameter(request, tier, param_id, client):
pass
return "-"


def get_sub_ta_parameter(subscription, tier, param_id, client):
try:
rql = R().configuration.account.id.eq(subscription['tiers'][tier]['id'])
Expand Down

0 comments on commit b77c429

Please sign in to comment.