Exemple #1
0
	def wrapper(request, *args, **kwargs):
		cookie = request.COOKIES
		id = cookie.get('id')
		token = cookie.get('token')
		if id is not None and token is not None:
			response = requests.get(sessionServer + "/check?id=" + id + "&token=" + token)
			if response.status_code == 200:
				session = response.json()
				session['id'] = id
				session['token'] = token
				return func(request, session=session, *args, **kwargs)
		loginfo("session is None")
		return func(request, *args, **kwargs)
Exemple #2
0
 def wrapper(request, *args, **kwargs):
     cookie = request.COOKIES
     id = cookie.get('id')
     token = cookie.get('token')
     if id is not None and token is not None:
         response = requests.get(sessionServer + "/check?id=" + id +
                                 "&token=" + token)
         if response.status_code == 200:
             session = response.json()
             session['id'] = id
             session['token'] = token
             return func(request, session=session, *args, **kwargs)
     loginfo("session is None")
     return func(request, *args, **kwargs)
Exemple #3
0
 def wrapper(r, *args, **kwargs):
     loginfo(r.method + " " + r.get_full_path())
     return func(r, *args, **kwargs)
Exemple #4
0
	def wrapper(r, *args, **kwargs):
		loginfo(r.method + " " + r.get_full_path())
		return func(r, *args, **kwargs)