소스 검색

[notebook] Only use session properties if they exist

(cherry picked from commit 3af82573a1d80351b7d9c55ca483ebffff7459ed)
Johan Ahlen 10 년 전
부모
커밋
72c28e77d6
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      apps/spark/src/spark/api.py

+ 1 - 1
apps/spark/src/spark/api.py

@@ -43,7 +43,7 @@ def create_session(request):
   snippet = json.loads(request.POST.get('snippet', '{}'))
 
   session = [session for session in notebook['sessions'] if snippet['type'] == session['type']]
-  if any(session):
+  if any(session) and 'properties' in session[0]:
     properties = session[0]['properties']
   else:
     properties = None