aboutsummaryrefslogtreecommitdiff
path: root/rhodecode/controllers/login.py
diff options
context:
space:
mode:
Diffstat (limited to 'rhodecode/controllers/login.py')
-rw-r--r--rhodecode/controllers/login.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/rhodecode/controllers/login.py b/rhodecode/controllers/login.py
index 1e75bb49..da9c07f8 100644
--- a/rhodecode/controllers/login.py
+++ b/rhodecode/controllers/login.py
@@ -54,10 +54,9 @@ class LoginController(BaseController):
def index(self):
# redirect if already logged in
c.came_from = request.GET.get('came_from')
-
- if self.rhodecode_user.is_authenticated \
- and self.rhodecode_user.username != 'default':
-
+ not_default = self.rhodecode_user.username != 'default'
+ ip_allowed = self.rhodecode_user.ip_allowed
+ if self.rhodecode_user.is_authenticated and not_default and ip_allowed:
return redirect(url('home'))
if request.POST: