[Fixed]-Save() takes at least 2 arguments (1 given)

1đź‘Ť

Django’s Model API expects that Model.save() sticks to the defined signature, as quite a few other parts of the framework, contribs and third part apps rely on this.

Also sending mails from the Model.save() method is really a terrible idea… You have to understand that models are (and must remain) strictly decoupled from the HTTP request (views…) cycle – as they may be modified by other code too (think custom management commands etc) and you won’t necessarily have a “current user” at hand (nor want to send mails to anyone).

In you case since you’re obviously only concerned by changed made thru your app’s views the mail should be send by the view itself.

Leave a comment