def on_login(sender, user, **kwargs): """ Executed when a user has just logged in """ #update notifications pertaining to items Item.update_notifications(user)
def update_user_notifications(): """ Cycles through all active users and updates their notifications """ userset = User.objects.filter(is_active=True) for user in userset: Item.update_notifications(user)