def validate_ip_address(self):
		ip_list = frappe.db.get_value('User', self.user, 'restrict_ip', ignore=True)
		if not ip_list:
			return

		ip_list = ip_list.replace(",", "\n").split('\n')
		ip_list = [i.strip() for i in ip_list]

		for ip in ip_list:
			if frappe.local.request_ip.startswith(ip):
				return

		frappe.throw(_("Not allowed from this IP Address"), frappe.AuthenticationError)
Set :py:attr:`forwarded` and :py:attr:`q`.
dataset/ETHPy150Open frappe/frappe/frappe/auth.py/LoginManager.validate_ip_address--crossover with--dataset/ETHPy150Open yourlabs/django-autocomplete-light/src/dal/views.py/ViewMixin.dispatch