MongoEngine / MongoEngine/mongoengine

pre_save signal does not send created argument

Open
#2,046 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
4.3k
Forks
1.2k
Avg merge
4h 41m
Merged PRs (30d)
11

Description

According to the documentation there's an example of the usage of the pre_save signal to detect when an object was created. I wasn't getting the argument so I examined the code and noticed that it's not sent.

It is sent on the pre_save_post_validation signal tough.

Should the documentation be changed or the code? I'm willing to send a PR if it's necessary.

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the pre_save documentation at docs.mongoengine.org/guide/signals.html with the signal dispatch in mongoengine/document.py around line 372. Check how pre_save_post_validation receives the created argument, then determine whether the documented behavior or the code should be aligned and verify the resulting signal behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb, python
Domain
database
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.