Not getting signal from Flask-Security

2019-08-15 20:08发布

问题:

I want to receive the user_registered signal from Flask-Security and have to set up like so:

from flask.ext.security.signals import user_registered

@user_registered.connect_via(app)
def user_registered_sighandler(sender, **extra):
    sender.logger.debug("logger-user_registered_sighandler:", extra)
    print "print-user_registered_sighandler:", extra

But my signal handler is not being called when a new user is registered. I've set up a Flask (not Flask-Security) signal similar to above that does work. Can anyone help with this?

I'm using: Flask==0.9, Flask-Security==1.5.4, blinker==1.2

回答1:

This was a bug fixed in v1.6.1 of Flask-Security