我在用户注册时发送了 2 个信号,socialauth_registered 和 post_save。我希望 socialauth_registered 在 post_save 之前,因为它会影响 post_save 触发的功能。
这可能吗?(如果是,如何?!)
我不确定究竟是什么相关的,但我有:
from django.contrib.auth.models import User
from social_auth.signals import socialauth_registered, pre_update
from django.db.models.signals import post_save
<ALL OF MY MODELS>
def create_user_profile(sender, instance, created, **kwargs):
do some stuff
def create_social_profile(sender, user, response, details, **kwargs):
do other stuff
socialauth_registered.connect(create_social_profile, sender=None)
post_save.connect(create_user_profile, sender=User)