SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 23fe534f authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Path error in deposit

parent 9126eacd
No related branches found
No related tags found
No related merge requests found
...@@ -489,7 +489,7 @@ def metadata_xml_deposit(request, doi_label, option='test'): ...@@ -489,7 +489,7 @@ def metadata_xml_deposit(request, doi_label, option='test'):
'<doi_batch_id>')[2].partition('</doi_batch_id>')[0] '<doi_batch_id>')[2].partition('</doi_batch_id>')[0]
# Find Crossref xml files # Find Crossref xml files
path = settings.MEDIA_ROOT path = ''
if publication.in_issue: if publication.in_issue:
path += '{issue_path}/{paper_nr}/{doi_label}_Crossref'.format( path += '{issue_path}/{paper_nr}/{doi_label}_Crossref'.format(
issue_path=publication.in_issue.path, issue_path=publication.in_issue.path,
...@@ -508,7 +508,7 @@ def metadata_xml_deposit(request, doi_label, option='test'): ...@@ -508,7 +508,7 @@ def metadata_xml_deposit(request, doi_label, option='test'):
valid = True valid = True
response_headers = None response_headers = None
response_text = None response_text = None
if os.path.isfile(path): if os.path.isfile(settings.MEDIA_ROOT + path):
# Deposit already done before. # Deposit already done before.
valid = False valid = False
else: else:
...@@ -611,7 +611,7 @@ def metadata_DOAJ_deposit(request, doi_label): ...@@ -611,7 +611,7 @@ def metadata_DOAJ_deposit(request, doi_label):
timestamp = publication.metadata_xml.partition('<timestamp>')[2].partition('</timestamp>')[0] timestamp = publication.metadata_xml.partition('<timestamp>')[2].partition('</timestamp>')[0]
# Find DOAJ xml files # Find DOAJ xml files
path = settings.MEDIA_ROOT path = ''
if publication.in_issue: if publication.in_issue:
path += '{issue_path}/{paper_nr}/{doi_label}_DOAJ'.format( path += '{issue_path}/{paper_nr}/{doi_label}_DOAJ'.format(
issue_path=publication.in_issue.path, issue_path=publication.in_issue.path,
...@@ -626,7 +626,7 @@ def metadata_DOAJ_deposit(request, doi_label): ...@@ -626,7 +626,7 @@ def metadata_DOAJ_deposit(request, doi_label):
path_wo_timestamp = path + '.json' path_wo_timestamp = path + '.json'
path += '_{timestamp}.json'.format(timestamp=timestamp) path += '_{timestamp}.json'.format(timestamp=timestamp)
if os.path.isfile(path): if os.path.isfile(settings.MEDIA_ROOT + path):
errormessage = 'The metadata file for this metadata timestamp already exists' errormessage = 'The metadata file for this metadata timestamp already exists'
return render(request, 'scipost/error.html', context={'errormessage': errormessage}) return render(request, 'scipost/error.html', context={'errormessage': errormessage})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment