Skip to content

use dict.get rather than if key in dict #44

@hobson

Description

@hobson

Is:

if 'counter' not in request_data['context']:
            request_data['context']['counter'] = 1
        else:
            request_data['context']['counter']

Should be:

request_data['context']['counter'] = int(
    request_data['context'].get('counter', 0)) + 1

if 'counter' not in request_data['context']:

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