Commit 9a489711 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Fix bugs.

parent 7a1d1f17
......@@ -272,7 +272,7 @@ class Msg(Storage):
@type collection: str
@param collection: the collection containing the record
@type harvester: gluon.dal.Row
@type harvester: gluon.dal.Row or gluon.storage.Storage
@param harvester: the current harvester used to retrieve the record.
@type record_id: int
......@@ -284,7 +284,12 @@ class Msg(Storage):
"""
self.action = None
self.collection = collection
self.harvester = json.dumps(harvester.as_dict())
if isinstance(harvester, Storage):
self.harvester = harvester
else:
self.harvester = json.dumps(harvester.as_dict())
self.record_id = record_id
self.title = title
self.txt = None
......@@ -780,6 +785,7 @@ class PublicationsTool(object):
self.process_xml(xml)
except BaseException as e:
print traceback.format_exc()
url = OAI_URL % (self.harvester.host, id)
self.logs.append(Msg(harvester=self.harvester,
collection=title,
......@@ -1663,9 +1669,9 @@ class Proceedings(PublicationsTool):
# alias for the conference information
conference_dates = record.conference_dates()
conference_title = record.conference_title()
country = record.conference_country()
first_author = record.first_author()
id_country = get_id(db.countries, country=record.conference_country())
# check the collaboration
id_collaboration = self.check_collaboration(record.collaboration())
......@@ -1702,7 +1708,7 @@ class Proceedings(PublicationsTool):
first_author=first_author,
id_categories=self.harvester.id_categories,
id_collaborations=id_collaboration,
id_countries=get_id(country),
id_countries=id_country,
id_projects=self.harvester.id_projects,
id_publishers=id_publisher,
id_status=UNDEF_ID,
......@@ -2038,8 +2044,8 @@ class Talks(PublicationsTool):
# alias for the conference information
conference_dates = record.conference_dates()
conference_title = record.conference_title()
country = record.conference_country()
first_author = record.first_author()
id_country = get_id(db.countries, country=record.conference_country())
submitted = record.submitted()[0]
title = record.title()
......@@ -2068,7 +2074,7 @@ class Talks(PublicationsTool):
first_author=first_author,
id_categories=self.harvester.id_categories,
id_collaborations=id_collaboration,
id_countries=get_id(country),
id_countries=id_country,
id_projects=self.harvester.id_projects,
id_status=UNDEF_ID,
id_teams=self.harvester.id_teams,
......
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