Skip to content

Fix report payload to not always override#129

Merged
shenanigansd merged 1 commit intomainfrom
email-fix
Jul 18, 2023
Merged

Fix report payload to not always override#129
shenanigansd merged 1 commit intomainfrom
email-fix

Conversation

@Robin5605
Copy link
Member

The popup modal is intended to be an "override" setting to override what's in the database. The Mainframe API would use the "override" if it's not None. However, discord.py returns "" for ui.TextInputs that were not filled out, which is not None. This meant that the empty string would always override what's in the database when sending the email report, which is undesirable.

This PR fixes it so that "" becomes None, which is then sent as the HTTP payload.

Comment on lines +43 to +44
additional_information_override = self.additional_information or None
inspector_url_override = self.inspector_url or None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove the _override suffix

Copy link
Contributor

@shenanigansd shenanigansd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shenanigansd shenanigansd merged commit 8521b9a into main Jul 18, 2023
@shenanigansd shenanigansd deleted the email-fix branch July 18, 2023 17:46
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

Successfully merging this pull request may close these issues.

3 participants