Commits

imbolc committed c840bfb

fix rq.ip and rq.ip_list

Comments (0)

Files changed (1)

     
     @cache_property
     def ip(self):
-        return self.environ.get('REMOTE_ADDR')
+        '''
+        Самый внешний ип
+        '''
+        return self.ip_list[-1]
 
     @cache_property
     def ip_list(self):
                     if 15 < x < 31:
                         continue
                 ret.append(ip)
-        if self.ip and self.ip not in ret:
-            ret.append(self.ip)
-        return ret
+        return ret or [self.environ.get('REMOTE_ADDR')]
 
     @cache_property
     def referer(self):