Exemplo n.º 1
0
def user_ip_history(request, username):
    user = get_object_or_404(User, username=username)
    ip_history = [(int_to_ip(ip), timestamp) for (ip, timestamp) in user.redis.ip_history.with_scores[:]]
    ctx = {
        'target_user': user,
        'ip_history': ip_history,
    }
    return r2r_jinja('staff/ip_history.html', ctx, request)
Exemplo n.º 2
0
def user_ip_history(request, username):
    user = get_object_or_404(User, username=username)
    ip_history = [(int_to_ip(ip), timestamp)
                  for (ip, timestamp) in user.redis.ip_history.with_scores[:]]
    ctx = {
        'target_user': user,
        'ip_history': ip_history,
    }
    return r2r_jinja('staff/ip_history.html', ctx, request)
Exemplo n.º 3
0
def staff_user_ip_history(request, username):
    user = get_object_or_404(User, username=username)
    ip_history = [(int_to_ip(ip), timestamp) for (ip, timestamp) in user.redis.ip_history.with_scores[:]]
    return r2r('staff/ip_history.django.html', locals())
Exemplo n.º 4
0
 def test_known_int_to_ip(self):
     for (ip, integer) in self.ip_int_pairs:
         self.assertEqual(util.int_to_ip(integer), ip, "util.int_to_ip(%r) != %r" % (integer, ip))
Exemplo n.º 5
0
 def test_known_int_to_ip(self):
     for (ip, integer) in self.ip_int_pairs:
         self.assertEqual(util.int_to_ip(integer), ip,
                          "util.int_to_ip(%r) != %r" % (integer, ip))