comparison rhodecode/model/db.py @ 3212:6c28533d122c beta

IP restrictions now also enabled for IPv6
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 23 Jan 2013 23:51:57 +0100
parents a665d8cdd351
children b4daef4cc26d
comparison
equal deleted inserted replaced
3211:c77a846a24d5 3212:6c28533d122c
560 user = relationship('User', lazy='joined') 560 user = relationship('User', lazy='joined')
561 561
562 @classmethod 562 @classmethod
563 def _get_ip_range(cls, ip_addr): 563 def _get_ip_range(cls, ip_addr):
564 from rhodecode.lib import ipaddr 564 from rhodecode.lib import ipaddr
565 net = ipaddr.IPv4Network(ip_addr) 565 net = ipaddr.IPNetwork(address=ip_addr)
566 return [str(net.network), str(net.broadcast)] 566 return [str(net.network), str(net.broadcast)]
567 567
568 def __json__(self): 568 def __json__(self):
569 return dict( 569 return dict(
570 ip_addr=self.ip_addr, 570 ip_addr=self.ip_addr,