Skip to content
Snippets Groups Projects
Commit e13e5834 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Removed debug output

parent 3dbb1204
No related branches found
No related tags found
No related merge requests found
...@@ -48,8 +48,9 @@ class CheckLoginMiddleware(object): ...@@ -48,8 +48,9 @@ class CheckLoginMiddleware(object):
# 1. Is last_modified not present or more than 24 hours ago? # 1. Is last_modified not present or more than 24 hours ago?
# If so: check with VIPSLogic if user_uuid is valid # If so: check with VIPSLogic if user_uuid is valid
last_modified = request.session.get("last_modified", None) last_modified = request.session.get("last_modified", None)
print last_modified #print last_modified
age_limit = timedelta(days = 1) age_limit = timedelta(days = 1)
#age_limit = timedelta(seconds = 10)
if last_modified == None or datetime.strptime(last_modified, CheckLoginMiddleware.datetime_format) < datetime.now() - age_limit: if last_modified == None or datetime.strptime(last_modified, CheckLoginMiddleware.datetime_format) < datetime.now() - age_limit:
# 2. If not, check if UUID is present # 2. If not, check if UUID is present
# If UUID present, try to login to VIPSLogic with it # If UUID present, try to login to VIPSLogic with it
...@@ -57,6 +58,7 @@ class CheckLoginMiddleware(object): ...@@ -57,6 +58,7 @@ class CheckLoginMiddleware(object):
if user_uuid != None: if user_uuid != None:
found_user = VipsLogicUser.find_by_uuid(user_uuid) found_user = VipsLogicUser.find_by_uuid(user_uuid)
if found_user != None: if found_user != None:
print "Found user. Logging in."
request.session["vips_logic_user"] = found_user request.session["vips_logic_user"] = found_user
request.session["user_uuid"] = user_uuid request.session["user_uuid"] = user_uuid
request.session["last_modified"] = datetime.now().strftime(CheckLoginMiddleware.datetime_format) request.session["last_modified"] = datetime.now().strftime(CheckLoginMiddleware.datetime_format)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment