Skip to content

Commit

Permalink
Merge pull request #894 from fabiobatalha/import_fix
Browse files Browse the repository at this point in the history
Correção de importação para revista atender importação da revista: Interface - Comunicação, Saúde, Educação
  • Loading branch information
fabiobatalha committed Jul 16, 2014
2 parents 63bc58b + 7e72034 commit 98ad8ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions scielomanager/tools/import_data/issueimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def load_issue(self, record):
if record['41'][0] == 'pr':
issue.is_press_release = True

month_start = 0
if '43' in record:
expanded = subfield.expand(record['43'][0])
month_start = dict(expanded)
Expand All @@ -192,11 +193,13 @@ def load_issue(self, record):
else:
issue.total_documents = 0

month_end = '01'
if '65' in record:
year = record['65'][0][0:4]
month_end = record['65'][0][4:6]
if month_end == '00':
month_end = '01'

issue.publication_start_month = month_start
issue.publication_end_month = month_end
issue.publication_year = int(year)
Expand Down
2 changes: 1 addition & 1 deletion scielomanager/tools/import_data/journalimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def try_update_previous_title(self, json_file, collection):
next_journal = Journal.objects.filter(title__exact=record['710'][0],
collections=collection).update(previous_title=previous_journal.id)
except Journal.DoesNotExist:
print "Not possible to update the previous title of the journal: " + next_journal.title
print "Not possible to update the previous title of the journal: %s" % record['100'][0]

def run_import(self, json_file, collection, user):
"""
Expand Down

0 comments on commit 98ad8ed

Please sign in to comment.