fix url-writing bug

pull/1/head
Andromeda Yelton 2013-07-24 10:19:21 -04:00
parent ec57b7efee
commit e7ac7febfd
1 changed files with 5 additions and 6 deletions

View File

@ -6,7 +6,6 @@ Use the MARCXML file for the non-unglued edition from Library of Congress.
"""
import logging
import sys
import pymarc
from copy import deepcopy
from datetime import datetime
@ -213,7 +212,7 @@ def makemarc(marcfile, license, edition):
zeroes = 9 - len(str(marc_id_via))
accession_via = 'ung' + zeroes*'0' + str(marc_id_via)
field001 = pymarc.Field(tag='001', data=accession_via)
record.add_ordered_field(field001)
record_via_unglueit.add_ordered_field(field001)
# write the unglued MARCxml records
xml_filename = directory + '/' + accession + '_unglued.xml'
@ -253,8 +252,8 @@ def makemarc(marcfile, license, edition):
marc_record.mrc_record = default_storage.url(mrc_filename)
marc_record.marc_format = 'DIRECT'
marc_record.save()
marc_record_via.xml_record_via_unglueit = default_storage.url(xml_filename_via)
marc_record_via.mrc_record_via_unglueit = default_storage.url(mrc_filename_via)
marc_record_via.xml_record = default_storage.url(xml_filename_via)
marc_record_via.mrc_record = default_storage.url(mrc_filename_via)
marc_record_via.marc_format = 'UNGLUE'
marc_record_via.save()
logger.info("MARCRecord instances complete for edition %s with accession numbers %s and %s" % (edition, accession, accession_via))