Skip to content

Conversation

@onerandomusername
Copy link
Contributor

closes #3402

for attachment in message.attachments:
if (
attachment.content_type
and attachment.content_type.startswith("text/plain")
Copy link
Contributor

Choose a reason for hiding this comment

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

We also want to offer to upload files like text/csv or application/json, I think having a charset is enough to offer to upload it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm, should I check that the charset actually equals utf-8?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@wookie184 wookie184 left a comment

Choose a reason for hiding this comment

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

LGTM

@onerandomusername onerandomusername marked this pull request as draft October 24, 2025 22:47
@onerandomusername
Copy link
Contributor Author

Converted to draft for now as I forgot to add checking for the other use mentioned in the attached issue:

for a in msg.attachments if "charset" in a.content_type

@onerandomusername onerandomusername marked this pull request as ready for review October 26, 2025 04:32
@onerandomusername
Copy link
Contributor Author

fixed the attribute error in filtering and marked as ready for review again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issues due to lack of check for when Attachment.content_type is None

3 participants