Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LITE-29386 Extend condition in param retrieval to include name comparison #7

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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