Skip to content

Conversation

@ZuluPro
Copy link

@ZuluPro ZuluPro commented Feb 22, 2021

Added signals for external usage:

  • pre_submit
  • post_submit
  • pre_send
  • post_send

@ZuluPro
Copy link
Author

ZuluPro commented Feb 28, 2021

Hi @jezdez, Any news ?

@ZuluPro
Copy link
Author

ZuluPro commented Mar 14, 2021

@jezdez @dokterbob ?

Copy link
Member

@jezdez jezdez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
signals.post_send.send(sender=self.__class__, message=self, email=message,
signals.post_send.send(sender=self.__class__, submission=self, message=message,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants