From 14e9364d42a3d5248cc087d074c6ef4afd5780fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alexandre=20Delano=C3=AB?= <alexandre@delanoe.org>
Date: Fri, 5 Dec 2014 16:13:43 +0100
Subject: [PATCH] [FIX] Adjacency matrix bug, url disappeared (maybe because of
 merge).

---
 analysis/functions.py  | 7 +------
 gargantext_web/urls.py | 2 +-
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/analysis/functions.py b/analysis/functions.py
index 950831ec..87f882c1 100644
--- a/analysis/functions.py
+++ b/analysis/functions.py
@@ -133,7 +133,7 @@ def create_cooc(user=None, corpus=None, whitelist=None, size=150):
     cursor.execute(query_cooc)
     return cooc
 
-def get_cooc(request=None, corpus_id=None, cooc_id=None, type="node_link"):
+def get_cooc(request=None, corpus_id=None, cooc_id=None, type="node_link", n=150):
     import pandas as pd
     from copy import copy
     import numpy as np
@@ -152,11 +152,6 @@ def get_cooc(request=None, corpus_id=None, cooc_id=None, type="node_link"):
 
     if Node.objects.filter(type=type_cooc, parent=corpus).first() is None:
         print("Coocurrences do not exist yet, create it.")
-        if type == "node_link":
-            n = 150
-        elif type == "adjacency":
-            n = 50
-
         whitelist = create_whitelist(request.user, corpus, size=n)
         cooccurrence_node = create_cooc(user=request.user, corpus=corpus, whitelist=whitelist, size=n)
         print(cooccurrence_node.id, "Cooc created")
diff --git a/gargantext_web/urls.py b/gargantext_web/urls.py
index 059dc5c9..050fac13 100644
--- a/gargantext_web/urls.py
+++ b/gargantext_web/urls.py
@@ -35,7 +35,7 @@ urlpatterns = patterns('',
     # Getting data
     url(r'^chart/corpus/(\d+)/data.csv$', views.send_csv),
     url(r'^corpus/(\d+)/node_link.json$', views.node_link),
-    url(r'^corpus/(\d+)/adjancy_matrix$', views.node_link),
+    url(r'^corpus/(\d+)/adjacency.json$', views.node_link),
 
     url(r'^api$', gargantext_web.api.Root),
     url(r'^api/nodes/(\d+)/children/metadata$', gargantext_web.api.NodesChildrenMetatadata.as_view()),
-- 
2.21.0