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

Add filename of attachment #68

Merged

Conversation

wgresshoff
Copy link
Contributor

❤️ Thank you for your contribution!

Description

Please describe briefly your pull request.

Currently there is no possibility to set the name of an attachment. This PR will add the possibility.

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Frontend

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

@wgresshoff wgresshoff requested a review from ntarocco January 8, 2025 10:55
Comment on lines +86 to +88
filename = None
if "filename" in attachment:
filename = attachment.get("filename")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is None an accepted value by msg.attach for the filename?

Suggested change
filename = None
if "filename" in attachment:
filename = attachment.get("filename")
filename = attachment.get("filename")

Copy link
Contributor Author

@wgresshoff wgresshoff Jan 15, 2025

Choose a reason for hiding this comment

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

Yes, None is accepted. But if you just call attachment.get("filename") and the key doesn't exist a KeyError will be raised.

@ntarocco ntarocco merged commit 24ef09a into inveniosoftware:master Jan 29, 2025
3 checks passed
slint added a commit to zenodo/zenodo-rdm that referenced this pull request Feb 7, 2025
📁 invenio-administration (3.0.0 -> 3.1.0 🌈)

    release: v3.1.0
    modal: add support for custom modal SUI props

📁 invenio-mail (2.2.0 -> 2.2.1 🐛)

    release: v2.2.1
    upgrade CI
    Add filename of attachments (inveniosoftware/invenio-mail#68)

📁 invenio-oauth2server (3.0.0 -> 3.0.2 🐛)

    📦 release: v3.0.2
    refactor: copy code from flask-oauthlib-invenio

    * the problem is that request.form triggers parsing the form. parsing
      the form triggers checking the max_content_length. if a file greater
      then the allowed filesize is uploaded this raises the
      RequestEntityTooLarge exception

    * to verify the request the body is not used, the token is used for
      verification
    release: v3.0.1
    fix: update iter_choices to include additional parameter in SelectSUI

📁 invenio-records-resources (7.0.0 -> 7.0.1 🐛)

    📦 release: v7.0.1
    fix: file upload >100MB

    * flask uses now the MAX_CONTENT_LENGTH to restrict file upload. it is
      possible to set the max_content_length per request. so for this request
      it is set to the configured max file size
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.

2 participants