def profile_changed(sender, instance, **kwargs): # import 写在函数里面避免循环依赖 from accounts.services import UserService # note: it's user_id instead of id UserService.invalidate_profile(instance.user_id)
def profile_changed(sender, instance, **kwargs): # import inside a function to prevent cycling dependence from accounts.services import UserService UserService.invalidate_profile(instance.user_id)
def profile_changed(sender, instance, **kwargs): from accounts.services import UserService UserService.invalidate_profile(instance.user_id)
def profile_changed(sender, instance, **kwargs): # import only in function to avoid cyclic dependencies from accounts.services import UserService UserService.invalidate_profile(instance.user_id)
def profile_changed(sender, instance, **kwargs): # import avoid circular dependency from accounts.services import UserService UserService.invalidate_profile(instance.user_id)