Commit 28cb31ce authored by Alexandre Delanoë's avatar Alexandre Delanoë

Merge branch 'testing' into stable

parents 6622956b 27829aa3
......@@ -2,6 +2,11 @@
* Guided Tour
* Sources form highlighting crawlers
## Version 3.0.8.1
* WOS parser date FIX
* EUROPRESS parser author/text article FIX
* Backend: each project as user node as parent
## Version 3.0.7
* Alembic implemented to manage database migrations
......
......@@ -81,8 +81,9 @@ class EuropresseParser(Parser):
# "./header/div/p[@class='titreArticleVisu grandTitre']"
#
# title_xpath (chemin plus générique)
title_xpath = "./header//*[contains(@class,'titreArticle')]"
text_xpath = "./section/div[@class='DocText']//p"
title_xpath = "./header//*[contains(@class,'titreArticleVisu rdp__articletitle')]"
authors_xpath = "./header//*[contains(@class,'docAuthors')]"
text_xpath = "./section/div[@class='DocText clearfix']//p"
entire_header_xpath = "./header"
# diagnosed during date retrieval and used for rubrique
......@@ -144,6 +145,15 @@ class EuropresseParser(Parser):
yield(hyperdata)
continue
# Authors
# --------
try:
authors = scrap_text(html_article.xpath(authors_xpath))
hyperdata['authors'] = '; '.join([author for author in authors])
except:
pass
# FULLTEXT
# --------
......@@ -154,6 +164,7 @@ class EuropresseParser(Parser):
except:
pass
# PUBLICATIONNAME
# ----------------
try:
......
......@@ -5,6 +5,7 @@ from collections import defaultdict
from gargantext.util.toolchain import *
import copy
from gargantext.util.db import session
from gargantext.models import UserNode
class ProjectList(APIView):
'''API endpoint that represent a list of projects owned by a user'''
......@@ -36,10 +37,16 @@ class ProjectList(APIView):
return Response({"detail":"Project with this name already exists", "url":"/projects/%s" %str(project.id)}, status = HTTP_409_CONFLICT)
else:
user_node = session.query(UserNode).filter_by(user_id=request.user.id).one_or_none()
if user_node is None:
print("??? Can't find UserNode for %r to create ProjectNode with name %r ???" % (request.user, name))
new_project = Node(
user_id = request.user.id,
typename = 'PROJECT',
name = name,
parent_id = user_node and user_node.id,
)
session.add(new_project)
......
......@@ -367,7 +367,7 @@
<p>
Gargantext
<span class="glyphicon glyphicon-registration-mark" aria-hidden="true"></span>
, version 3.0.8,
, version 3.0.8.1,
<a href="http://www.cnrs.fr" target="blank" title="Institution that enables this project.">
Copyrights
<span class="glyphicon glyphicon-copyright-mark" aria-hidden="true"></span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment