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

Bug: publication_approved never accesses errors param #30

Open
sliedig opened this issue Jun 14, 2023 · 0 comments
Open

Bug: publication_approved never accesses errors param #30

sliedig opened this issue Jun 14, 2023 · 0 comments
Labels
bug Something isn't working triage Pending triage from maintainers

Comments

@sliedig
Copy link
Contributor

sliedig commented Jun 14, 2023

Expected Behaviour

publication_approved method never access errors

Current Behaviour

No issue, parameter is never used

Code snippet

def lambda_handler(event, context):
    """Main entry point for Property Approval lambda function

    Parameters
    ----------
    event : API Gateway Lambda Proxy Request
        The event passed to the function.
    context : AWS Lambda Context
        The context for the Lambda function.

    Returns
    -------
    Success message upon successful storage of the approval outcome into DynamoDB
    """

    logger.info(event)

    errors = None if 'workflowErrors' not in event['detail'] else event['detail'].pop('workflowErrors')

    # Deserialize event into strongly typed object
    awsEvent:AWSEvent = Marshaller.unmarshall(event, AWSEvent)  # type: ignore
    detail:PublicationEvaluationCompleted = awsEvent.detail  # type: ignore

    return publication_approved(detail, errors)def lambda_handler(event, context):
    """Main entry point for Property Approval lambda function

    Parameters
    ----------
    event : API Gateway Lambda Proxy Request
        The event passed to the function.
    context : AWS Lambda Context
        The context for the Lambda function.

    Returns
    -------
    Success message upon successful storage of the approval outcome into DynamoDB
    """

    logger.info(event)

    errors = None if 'workflowErrors' not in event['detail'] else event['detail'].pop('workflowErrors')

    # Deserialize event into strongly typed object
    awsEvent:AWSEvent = Marshaller.unmarshall(event, AWSEvent)  # type: ignore
    detail:PublicationEvaluationCompleted = awsEvent.detail  # type: ignore

    return publication_approved(detail, errors)

Possible Solution

No response

Steps to Reproduce

N/A

Debugging logs

No response

@sliedig sliedig added bug Something isn't working triage Pending triage from maintainers labels Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Pending triage from maintainers
Projects
None yet
Development

No branches or pull requests

1 participant