예제 #1
0
def stop_tracking(request, tracker):
    user = tracker.user
    user.last_login = tracker.last_click
    user.last_ip = tracker.current_ip
    user.save(update_fields=['last_login', 'last_ip'])

    if tracker.is_visible_on_index:
        clear_ranks_online_cache()

    tracker.delete()
예제 #2
0
def stop_tracking(request, tracker):
    user = tracker.user
    user.last_login = tracker.last_click
    user.last_ip = tracker.current_ip
    user.save(update_fields=['last_login', 'last_ip'])

    if tracker.is_visible_on_index:
        clear_ranks_online_cache()

    tracker.delete()
예제 #3
0
def start_tracking(request, user):
    online_tracker = Online.objects.create(
        user=user,
        current_ip=request.user_ip,
        is_visible_on_index=user.rank.is_on_index)

    if online_tracker.is_visible_on_index:
        clear_ranks_online_cache()

    request.user.online_tracker = online_tracker
    request._misago_online_tracker = online_tracker
예제 #4
0
def update_tracker(request, tracker):
    tracker.current_ip = request.user_ip
    tracker.last_click = timezone.now()

    rank_visible_on_index = request.user.rank.is_on_index
    if tracker.is_visible_on_index != rank_visible_on_index:
        tracker.is_visible_on_index = rank_visible_on_index
        tracker.save(
            update_fields=['last_click', 'current_ip', 'is_visible_on_index'])
        clear_ranks_online_cache()
    else:
        tracker.save(update_fields=['last_click', 'current_ip'])
예제 #5
0
def start_tracking(request, user):
    online_tracker = Online.objects.create(
        user=user,
        current_ip=request._misago_real_ip,
        is_visible_on_index=user.rank.is_on_index
    )

    if online_tracker.is_visible_on_index:
        clear_ranks_online_cache()

    request.user.online_tracker = online_tracker
    request._misago_online_tracker = online_tracker
예제 #6
0
def update_tracker(request, tracker):
    tracker.current_ip = request._misago_real_ip
    tracker.last_click = timezone.now()

    rank_visible_on_index = request.user.rank.is_on_index
    if tracker.is_visible_on_index != rank_visible_on_index:
        tracker.is_visible_on_index = rank_visible_on_index
        tracker.save(update_fields=[
            'last_click', 'current_ip', 'is_visible_on_index'
        ])
        clear_ranks_online_cache()
    else:
        tracker.save(update_fields=['last_click', 'current_ip'])