Skip to content

Commit

Permalink
refactored function arg passes values instead of value
Browse files Browse the repository at this point in the history
  • Loading branch information
ramsharma-prog committed Jul 18, 2023
1 parent 4b4ca00 commit 6b3d1e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion fsd_utils/mapping/application/application_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def format_radio_field(answer):
return formatted_answer

except Exception: # noqa
current_app.logger.info("The answer doesn't seem to be a radio field.")
current_app.logger.info("continue: the answer doesn't seem to be a radio field.")
return answer


Expand Down
14 changes: 8 additions & 6 deletions fsd_utils/mapping/application/multi_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,21 @@ def format_keys_and_values(cls, key: str, value: list, index: enumerate):
Returns:
str: The formatted string representation of the key-value pair.
"""

print(f"VALUE: {value}")

def formatted_values(value):
def formatted_values(values):
return (
", ".join(
map(
str,
convert_bool_value([value])
if len(value) > 1
else convert_bool_value(value),
convert_bool_value([values])
if len(values) > 1
else convert_bool_value(values),
)
)
if isinstance(value, list)
else convert_bool_value(value)
if isinstance(values, list)
else convert_bool_value(values)
)

values = ".\n".join(
Expand Down

0 comments on commit 6b3d1e0

Please sign in to comment.