diff -r 78f174d908a0 -r 6289931858a7 src/hp/views.py --- a/src/hp/views.py Fri Nov 16 17:38:24 2012 +0100 +++ b/src/hp/views.py Fri Nov 16 18:33:51 2012 +0100 @@ -55,12 +55,6 @@ logger.debug(r_content.text) content = r_content.json - project_url = content['front_project'] - project_path = urlparse.urlparse(project_url).path - project_id = "" - if project_path: - project_path_parts = project_path.split("/") - project_id = project_path_parts[-1] if project_path_parts[-1] else project_path_parts[-2] kc_id = None topic_id = None @@ -70,6 +64,15 @@ if len(kc_relation_list) > 0: kc_id = kc_relation_list[0].graph_id topic_id = kc_relation_list[0].topic_id + project_id = kc_relation_list[0].project_id + + if not project_id: + project_url = content['front_project'] + project_path = urlparse.urlparse(project_url).path + project_id = "" + if project_path: + project_path_parts = project_path.split("/") + project_id = project_path_parts[-1] if project_path_parts[-1] else project_path_parts[-2] return render_to_response( 'hp/video_player.html',