예제 #1
0
파일: signals.py 프로젝트: cundi/MixBBS
def post_deleted(instance, **kwargs):
    Profile = utils.get_pybb_profile_model()
    User = compat.get_user_model()
    try:
        profile = utils.get_bb_profile(instance.author)
    except (Profile.DoesNotExist, User.DoesNotExist) as e:
        # When we cascade delete an user, profile and posts are also deleted
        pass
    else:
        profile.post_count = instance.author.posts.count()
        profile.save()
예제 #2
0
파일: bb_tags.py 프로젝트: cundi/MixBBS
def bb_get_profile(*args, **kwargs):
    try:
        return utils.get_bb_profile(kwargs.get('user') or args[0])
    except:
        return utils.get_pybb_profile_model().objects.none()
예제 #3
0
파일: bb_tags.py 프로젝트: cundi/MixBBS
def bb_get_profile(*args, **kwargs):
    try:
        return utils.get_bb_profile(kwargs.get('user') or args[0])
    except:
        return utils.get_pybb_profile_model().objects.none()