Skip to content

Fix Inconsistent Names and Dictionary Access #15

@Rob-S

Description

@Rob-S

In lambda_function.py, there are two different names for "actionable". The extra "n" should be removed from "actionnable". In addition, once that issue has been fixed, some statements will throw an error due to accessing the session_attributes dictionary using attribute access notation rather than item access notation.

For example, on lines 134 - 136 and 304 - 306, the code currently checks the session_attr for a key that will never exist with the existing code. But if the key was fixed, changing it to "actionable_history" when stored, such that it did exist, that key is retrieved as if it were an attribute, which throws an error "AttributeError: 'dict' object has no attribute 'actionnable_history'". Therefore:

actionnable_history = list()
if('actionable_history' in session_attr.keys()):
    actionnable_history = session_attr.actionnable_history

should be:

actionable_history = list()
if 'actionable_history' in session_attr:
    actionable_history = session_attr['actionable_history']

or even:

actionable_history = session_attr['actionable_history'] if 'actionable_history' in session_attr else list()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions