Open
Conversation
Author
|
Hi @jezdez, Any news ? |
Author
jezdez
requested changes
Jan 8, 2022
Member
jezdez
left a comment
There was a problem hiding this comment.
Sorry for the slow review @ZuluPro, this looks good in general and just needs some tweaks for the parameter names to account for what is being passed (a submission object) to the signal callback.
Also this would need to be documented to be merged :) Thank you!
| assert self.publish_date < now(), \ | ||
| 'Something smells fishy; submission time in future.' | ||
|
|
||
| signals.pre_submit.send(sender=self.__class__, message=self) |
Member
There was a problem hiding this comment.
The parameter shouldn't be called message if the object passed isn't a message but the submission object.
Suggested change
| signals.pre_submit.send(sender=self.__class__, message=self) | |
| signals.pre_submit.send(sender=self.__class__, submission=self) |
| finally: | ||
| self.sending = False | ||
| self.save() | ||
| signals.post_submit.send(sender=self.__class__, message=self) |
Member
There was a problem hiding this comment.
Suggested change
| signals.post_submit.send(sender=self.__class__, message=self) | |
| signals.post_submit.send(sender=self.__class__, submission=self) |
| "text/html" | ||
| ) | ||
|
|
||
| signals.pre_send.send(sender=self.__class__, message=self, email=message) |
Member
There was a problem hiding this comment.
Suggested change
| signals.pre_send.send(sender=self.__class__, message=self, email=message) | |
| signals.pre_send.send(sender=self.__class__, submission=self, message=message) |
| 'error': e} | ||
| ) | ||
| error = e | ||
| signals.post_send.send(sender=self.__class__, message=self, email=message, |
Member
There was a problem hiding this comment.
Suggested change
| signals.post_send.send(sender=self.__class__, message=self, email=message, | |
| signals.post_send.send(sender=self.__class__, submission=self, message=message, |
716b4d8 to
e48481c
Compare
87e32e0 to
7071815
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added signals for external usage: