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)
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())
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))