Skip to content

save() prohibited to prevent data loss due to unsaved related object 'Mailbox' #219

@sane5ek

Description

@sane5ek

If you have Djongo (MongoDB Connector based on pymongo) in your project:

save() prohibited to prevent data loss due to unsaved related object 'Mailbox'

when trying to

mailbox.get_new_mail()

That's because Djongo use Model._id instead of Model.id field. When trying to save mailbox object again, that creates new database record with the same fields as mailbox object.

My fix - import models from djongo app in django_mailbox.models file and adding field

_id = models.ObjectIdField()

in Mailbox model.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions