django-mailbox icon indicating copy to clipboard operation
django-mailbox copied to clipboard

Cannot save message in django admin with empty eml field

Open cleonello opened this issue 8 years ago • 4 comments

Love django-mailbox. Came across some unexpected behavior, though. In the django admin, you cannot save a message if the eml ("Raw message contents") field is empty. It is a nullable field but required in the admin. Granted, this is likely a fringe use case, but it can be fixed by adding the "blank=True" option to the eml field in the Message model. That is, change this:

eml = models.FileField(
    _(u'Raw message contents'),
    null=True,
    upload_to="messages",
    help_text=_(u'Original full content of message')
)

to this:

eml = models.FileField(
    _(u'Raw message contents'),
    null=True,
    blank=True,
    upload_to="messages",
    help_text=_(u'Original full content of message')
)

I can create a pull request if necessary.

Thanks for all your work on this!

cleonello avatar Sep 26 '17 17:09 cleonello

Ahh; that does seem like a bug, I agree. Totally file a pull request (and, if you can, generate a migration) and I'll be glad to merge it.

coddingtonbear avatar Sep 26 '17 17:09 coddingtonbear

The pull request is there, but it hasn't been pulled into master. Why? Or did I get something wrong?

lsaffre avatar Mar 05 '21 15:03 lsaffre

@lsaffre , pull request does not fulfill project standard and author of pull request does not reply to change requests. See comments of pull request.

I may suggest taking over the job from a moderately cooperating PR author and proposing a PR that meets the project standards. This significantly increases the chance of being accepted.

ad-m avatar Mar 06 '21 23:03 ad-m

Understandable. I would love to help (and learn) a bit, but don't hope too much that this will happen. Too much work for my own projects. We use django-mailbox for a Lino plugin (https://www.lino-framework.org/api/lino_xl.lib.mailbox.html) and it works well (when we patch this little problem), but the plugin isn't used on any production site at the moment. When some paying customer shows interest, we will jump in.

lsaffre avatar Mar 08 '21 16:03 lsaffre

Fixed in master branch, will be available in the next release.

pfouque avatar Dec 17 '23 08:12 pfouque