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

Remove items from payload dictionary if their value is None #30

Open
Esterni opened this issue Jul 20, 2020 · 1 comment
Open

Remove items from payload dictionary if their value is None #30

Esterni opened this issue Jul 20, 2020 · 1 comment

Comments

@Esterni
Copy link
Owner

Esterni commented Jul 20, 2020

Create class method from following code-block and apply to all functions so that they are removed from the URL query when sent to iRacing.

for key in payload.copy():
            if payload.get(key) is None:
                del(payload[key])
            else:
                pass

Functions need to be tested for proper functionality afterwards. It is known that a value of -1 is equal to the key being set to nothing key= but it is unknown if queries will still work if the key is removed entirely.

@Esterni
Copy link
Owner Author

Esterni commented Jul 20, 2020

Confirmed for event_results() that removing raceweek= did not affect results. (This was an endpoint that had raceweek= in the URL query when using iRacing's "My Results" page)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant